|
-
May 17th, 2003, 09:48 PM
#1
Thread Starter
New Member
How do I display everything in a listbox with a msgbox?
I'm using Visual Basics.NET 2002.
My form has 1 ComboBox, 1 ListBox and 3 Buttons.
Private Sub form_load...
ComboBox.Items.Add("Cherry")
ComboBox.Items.Add("Grape")
ComboBox.Items.Add("Mango")
End Sub
Private Sub ComboBox1_SelectedIndexChanged...
ListBox.Items.Add(ComboBox.SelectedItem)
End Sub
Private Sub ButtonClearList_Click
ListBox.Items.Clear
End Sub
Private Sub ButtonRemoveFruit_Click
If ListBox.SelectedIndex = -1 Then
MsgBox("No fruit was choosen.")
Else
Dim I As Integer = ListBox.SelectedIndex
ListBox.Items.RemoveAt(I)
End If
End Sub
Private Sub ButtonShowAllMyFruits_Click...
'After I picked, 1 Cherry, 2 Grapes and 4 Mangos from the ComboBox, _
'my chosen fruits will appear in the ListBox.
'How do I show all my choices in a message box?
'I want the message box to say "You picked 1 cherry, 2 grapes and 4 mangos.")
End Sub
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
|