0

Dear,
i want add the new item in combobox at run time,whiout databas.
i want user enter the new item in comobox.
plese help me

5
Contributors
10
Replies
23
Views
7 Years
Discussion Span
Last Post by c0deFr3aK
0

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.

0

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
0

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.

Frined,
i want Enter new item at run time.your coad is not work.
you chake it

0

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

Brother;
This coad add the item in combobox but temporary add,wen i close the form thes item will be remove ok,
Are you Pike my point????

0

Brother;
This coad add the item in combobox but temporary add,wen i close the form thes item will be remove ok,
Are you Pike my point????

if that is ur case..u need to conenct it to database and fetch the datas everytime u load ur form... if u add it like items.add it is for temp time till u close the form.... or id u want to be u can add the items in the form load event so everytime u load the form...the items will be there..


Cheers

Xulu

0

Hi Sister..

I can understand ur point but without database u cant finish ur task...
Adding items in form load will be a temprory thing but from database u can do that...

0

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..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.