E
enrico via DotNetMonster.com
how can i make a combobox that can store or add additional fields?
enrico via DotNetMonster.com said:how can i make a combobox that can store or add additional fields?
Trammel said:ComboBox1.Items.Add("blah")
ComboBox1.Items.Add("1234")
Trammel said:This can be expanded-on using a button labeled "+" or however you submit
changes to the form/box:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim iLoop As Long
Dim bFound As Boolean = False
For iLoop = 0 To ComboBox1.Items.Count - 1
If UCase(ComboBox1.Text) = UCase(ComboBox1.Items.Item(iLoop)) Then
bFound = True
Next
If bFound = False Then ComboBox1.Items.Add(ComboBox1.Text)
End Sub
enrico via DotNetMonster.com said:i'm sorry, i can barely grasp what you meant about the .tostring() part.
i'm
not yet familiar on this language. can you elaborate more... tnx...
enrico via DotNetMonster.com said:thanks for the help trammel. i plainly use the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If Not ComboBox1.Items.Contains(ComboBox1.Text) Then
ComboBox1.Items.Add(ComboBox1.Text)
End Sub
and it worked.. but is there a way that those new fields that were entered
in
the combobox will be part of the combobox's list? for example: the fields
in
the combobox are B, C, D then i entered A. every time i close my form and
then reopen there are still 3 fields in the combobox. i want A be be part
of
that list, is it possible?