lawrenceDeC

Can someone please tell me how to use a combobox to add items at run time ex. When a user wants to add a item to an inventory list

thank you



Re: Visual Basic Language combobox adding items at run time

Spidermans_DarkSide - VSIP

Hi,

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

'Depending on if you want to be able to add more than one of say item1 then

'presuming you want to, make ComboBox2  your Inventory list

or you could add them to a STATIC array ( which holds the quantity of each item ).

' If you want to know how then just ask.>>

ComboBox2.Items.Add(ComboBox1.SelectedItem)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

'Clear INVENTORY LIST ComboBox2.

ComboBox2.Items.Clear()

End Sub

 

Regards,

S_DS

 






Re: Visual Basic Language combobox adding items at run time

Jay Vora

u can let user to add item thru textbox n from bton click event. add them to combobox.

another way is to use combobox 2 for display after any item added ..