如何在"ComboBox2"中按顺序显示最近输入过的字符

liushiying 2004-09-10 05:24:26
也是ComboBox2记录最近输入过的字符(按输入的时间排序)
...全文
225 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhxiongying 2004-09-29
  • 打赏
  • 举报
回复
Private Sub aa()
Dim Reg As RegistryKey '创建请求的注册表项
Reg = Registry.CurrentUser.CreateSubKey("Software\xiongying\aa\ArcHistory")
Reg = Registry.CurrentUser.OpenSubKey("Software\xiongying\aa\ArcHistory", True)
Select Case ComboBox2.Text
Case "*.*"
Case Reg.GetValue("0")
Case Reg.GetValue("1")
Case Reg.GetValue("2")
Case Reg.GetValue("3")
Case Reg.GetValue("4")
Case Reg.GetValue("5")
Case Else
Dim wj0 As String = Reg.GetValue("0")
Dim wj1 As String = Reg.GetValue("1")
Dim wj2 As String = Reg.GetValue("2")
Dim wj3 As String = Reg.GetValue("3")
Dim wj4 As String = Reg.GetValue("4")
Dim wj5 As String = Reg.GetValue("5")
Reg.SetValue("0", ComboBox2.Text)
If wj0 = "" Then
Reg.SetValue("1", "")
Else
Reg.SetValue("1", wj0)
End If

If wj1 = "" Then
Reg.SetValue("2", "")
Else
Reg.SetValue("2", wj1)
End If
If wj2 = "" Then
Reg.SetValue("3", "")
Else
Reg.SetValue("3", wj2)
End If
If wj3 = "" Then
Reg.SetValue("4", "")
Else
Reg.SetValue("4", wj3)
End If
If wj4 = "" Then
Reg.SetValue("5", "")
Else
Reg.SetValue("5", wj4)
End If
End Select
Reg.Close()
End Sub
Private Sub aaaa()
Dim Reg As RegistryKey '创建请求的注册表项
Reg = Registry.CurrentUser.CreateSubKey("Software\xiongying\aa\ArcHistory")
Reg = Registry.CurrentUser.OpenSubKey("Software\xiongying\aa\ArcHistory", True)

If Reg.GetValue("0") <> "" Then
ComboBox2.Items.Add(Reg.GetValue("0"))
End If
If Reg.GetValue("1") <> "" Then
ComboBox2.Items.Add(Reg.GetValue("1"))
End If
If Reg.GetValue("2") <> "" Then
ComboBox2.Items.Add(Reg.GetValue("2"))
End If
If Reg.GetValue("3") <> "" Then
ComboBox2.Items.Add(Reg.GetValue("3"))
End If
If Reg.GetValue("4") <> "" Then
ComboBox2.Items.Add(Reg.GetValue("4"))
End If
If Reg.GetValue("5") <> "" Then
ComboBox2.Items.Add(Reg.GetValue("5"))
End If
Reg.Close()
End Sub
Relta 2004-09-28
  • 打赏
  • 举报
回复
方法一是寫入注冊表,方法二是寫入ini文件中,方法三是寫入數據庫中!
haoztao 2004-09-28
  • 打赏
  • 举报
回复
windows中会自动记录的
liushiying 2004-09-28
  • 打赏
  • 举报
回复
里面是输入文件名如 "*.*" "*.exe "aa*.*"
如何编写呀
liushiying 2004-09-27
  • 打赏
  • 举报
回复
里面是输入文件名如 "*.*" "*.exe "aa*.*"
如何编写呀
LiloZhu 2004-09-14
  • 打赏
  • 举报
回复
up
yzg100 2004-09-14
  • 打赏
  • 举报
回复
建表来保存是个好方法嘛。不算麻烦呀。
lxcc 2004-09-14
  • 打赏
  • 举报
回复
http://www.yesky.com/20020705/1619201.shtml
koalapopo 2004-09-14
  • 打赏
  • 举报
回复
不顶
liushiying 2004-09-14
  • 打赏
  • 举报
回复
就象最近打开的文件一样
liushiying 2004-09-12
  • 打赏
  • 举报
回复
如何保存在注册表中
tx79 2004-09-11
  • 打赏
  • 举报
回复
这么麻烦啊
miaowei127 2004-09-11
  • 打赏
  • 举报
回复
建立一个临时表DataTable好了。然后和Combobox绑定

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧