|
-
May 13th, 2013, 12:10 PM
#1
Thread Starter
New Member
I need help with combo boxes in vb :o please help
Anything that I write in the textbox, the programme saves it to the drop down list in the combobox but it deletes it once I have closed the programme and opened it again so I tried the following code to ensure that it totally saved it and that it would be available next time I open the programme but it didn't work.....
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Me.ComboBox1.Items.Add(TextBox1.Text)
For Each comboItem As String In My.Settings.comboboxitems
Me.ComboBox1.Items.Add(comboItem)
Next
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
For Each comboItem As String In My.Settings.comboboxitems
Me.ComboBox1.Items.Add(comboItem)
Next
End Sub
End Class
Also, I want to make a programme with a combo box so that when you click an item in the box, it brings up something in a list box.
Basically, there are different recipes with lists of ingredients, how would I make the recipe name in the combobox display the ingredients in the list box when an item in the combo box is clicked??
e.g: if there were 3 items in the combo box: fudge cake, waffles and pancakes. If I selected the item "pancakes" then the list box would display something like this...
eggs, 1
milk, 200, ml
water, 10, ml
flour, 500, grams
(im pretty sure thats not how to make pancakes but its just an example)
any help would be greatly appreciated...
btw, im using vb 2010 and vb express
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|