如何创建存储历史记录的文本框?

时间:2014-11-19 01:32:04

标签: vb.net visual-studio-2010

我是初学者,我不知道如何制作恢复历史记录的文本框。 可以一个人。给我一个示例代码。或教我如何做到这一点。 即时通讯使用sql server作为我的数据库。 提前谢谢。

2 个答案:

答案 0 :(得分:2)

如果您要查找的是autoComplete功能,可以从文本框属性中启用它:

设置模式:

enter image description here

设置来源:

enter image description here

答案 1 :(得分:1)

Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load

    'Manually added some items
    lst.Add("apple")
    lst.Add("applle")
    lst.Add("appple")
    lst.Add("appplee")
    lst.Add("bear")
    lst.Add("pear")

    'Records binded to the AutocompleteStringCollection.
    MySource.AddRange(lst.ToArray)

    'this AutocompleteStringcollection binded to the textbox as custom
    'source.
    TextBox1.AutoCompleteCustomSource = MySource

    'Auto complete mode set to suggest append so that it will sugesst one
    'or more suggested completion strings it has bith ‘Suggest’ and
    '‘Append’ functionality
    TextBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend

    'Set to Custom source we have filled already
    TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
End Sub
相关问题