Hey
I'm doing a class project, and I keep running into issues with the checkedlistbox.
So here's the scenerio:
I have a form with one CheckedListBox, one button, and one textbox.
I want that when you press the button that the items selected inside the CheckedListBox should be displayed in the textbox.
Note: I want multiple selections.
Now, I know that if I type in the following code it will only show me one of the selections inside the checkedlistbox with the lowest index:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox1.Text = CheckedListBox1.SelectedItem.ToString()
End Sub
But how will I show multiple values inside textbox1?
I've done a little research and have discovered that changing the line:
TextBox1.Text = CheckedListBox1.SelectedItem.ToString()
to something like:
TextBox1.Text = CheckedListBox1.SelectedItems.ToString()
will supposedly display all the multiple selections inside the checkedlistbox . . . but when I debug the program it only shows the following inside the textbox:
System.Windows.Forms.ListBox+SelectedObjectCollection
I'm doing a class project, and I keep running into issues with the checkedlistbox.
So here's the scenerio:
I have a form with one CheckedListBox, one button, and one textbox.
I want that when you press the button that the items selected inside the CheckedListBox should be displayed in the textbox.
Note: I want multiple selections.
Now, I know that if I type in the following code it will only show me one of the selections inside the checkedlistbox with the lowest index:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox1.Text = CheckedListBox1.SelectedItem.ToString()
End Sub
But how will I show multiple values inside textbox1?
I've done a little research and have discovered that changing the line:
TextBox1.Text = CheckedListBox1.SelectedItem.ToString()
to something like:
TextBox1.Text = CheckedListBox1.SelectedItems.ToString()
will supposedly display all the multiple selections inside the checkedlistbox . . . but when I debug the program it only shows the following inside the textbox:
System.Windows.Forms.ListBox+SelectedObjectCollection