Use form load event to add stuff at runtime.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'add items in combobox here at runtime
End Sub
"i want user enter the new item in comobox." Sorry, I only speak English, and don't know what that means.
crazyhorse09
Junior Poster in Training
62 posts since Mar 2009
Reputation Points: 19
Solved Threads: 7
Try this
Private Sub Combo1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Combo1.KeyPress
If e.KeyChar=Chr(Keys.Enter) Then
Me.Combo1.Items.Add(Me.Combo1.Text) 'Any text entered into the combobox text will be added into the combobox item list after hiting Enter Key
End If
End Sub
c0deFr3aK
Junior Poster in Training
71 posts since Mar 2009
Reputation Points: 11
Solved Threads: 10
i guess you cannot store permanently any inputed texts into the combobox item list at runtime UNLESS you decide to have a database or if you load it first at design time.
If you want a permanent data to be loaded in your combobox then go for a database, there, you can add, subtract anytime you want.
i hope somebody could help you solve your problem..
c0deFr3aK
Junior Poster in Training
71 posts since Mar 2009
Reputation Points: 11
Solved Threads: 10