Writing the search word(s) to the text file.
Sub WriteWords()
Dim sw As StreamWriter = New StreamWriter("list.txt", True,
System.Text.Encoding.UTF8)
sw.WriteLine(Me.cmbSearch.Text)
sw.Close()
End Sub
Loading the combobox entries from the text file.
Sub LoadWords()
Dim sr As StreamReader = New StreamReader("list.txt")
Dim line As String
Do Until (line Is Nothing)
line = sr.ReadLine()
Me.cmbSearch.Items.Add(line)
Loop
sr.Close()
End Sub
Usage:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
LoadWords()
End Sub
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSearch.Click
'==>Searching code here
WriteWords()
Me.cmbSearch.Items.Clear()
LoadWords()
End Sub
tr************@za.syspro.com wrote:
Hello I want to have a combobox that saves all the input, so if I put
the word test in the combobox and submit a query I want to have test
saved so that the next time I go to that combobox I can click on the
letter T and all the inputs with the letter T comes through.