S
Steven Smith
I'm trying to display the contents of the
me.NamesListBox.SelectedItems property to a label on the
form. This works fine in single selection mode but
there's obviously something wrong with my syntax when
trying to call multiple items. the line in my code below
gives me the pre-compiler error along the lines of
value of type 'system.windows.form.textbox selected
object collection cannot be converted to string
///
Me.ResultLabel.Text = Me.NamesListBox.SelectedItems
///
any ideas guys, thanks in advance
Steve
///
Private Sub ExitButton_Click(ByVal sender As Object,
ByVal e As System.EventArgs) _
Handles ExitButton.Click
Me.Close()
End Sub
Private Sub MultiForm_Load(ByVal sender As Object,
ByVal e As System.EventArgs) _
Handles MyBase.Load
Me.NamesListBox.Items.Add("Ahmad")
Me.NamesListBox.Items.Add("Jim")
Me.NamesListBox.Items.Add("Debbie")
Me.NamesListBox.Items.Add("Jeanne")
Me.NamesListBox.Items.Add("Bill")
End Sub
Private Sub SingleButton_Click(ByVal sender As
Object, ByVal e As System.EventArgs) _
Handles SingleButton.Click
Me.ResultLabel.Text = Me.NamesListBox.SelectedItem
End Sub
Private Sub MultiButton_Click(ByVal sender As Object,
ByVal e As System.EventArgs) _
Handles MultiButton.Click
Me.ResultLabel.Text = ""
Me.ResultLabel.Text =
Me.NamesListBox.SelectedItems
///
me.NamesListBox.SelectedItems property to a label on the
form. This works fine in single selection mode but
there's obviously something wrong with my syntax when
trying to call multiple items. the line in my code below
gives me the pre-compiler error along the lines of
value of type 'system.windows.form.textbox selected
object collection cannot be converted to string
///
Me.ResultLabel.Text = Me.NamesListBox.SelectedItems
///
any ideas guys, thanks in advance
Steve
///
Private Sub ExitButton_Click(ByVal sender As Object,
ByVal e As System.EventArgs) _
Handles ExitButton.Click
Me.Close()
End Sub
Private Sub MultiForm_Load(ByVal sender As Object,
ByVal e As System.EventArgs) _
Handles MyBase.Load
Me.NamesListBox.Items.Add("Ahmad")
Me.NamesListBox.Items.Add("Jim")
Me.NamesListBox.Items.Add("Debbie")
Me.NamesListBox.Items.Add("Jeanne")
Me.NamesListBox.Items.Add("Bill")
End Sub
Private Sub SingleButton_Click(ByVal sender As
Object, ByVal e As System.EventArgs) _
Handles SingleButton.Click
Me.ResultLabel.Text = Me.NamesListBox.SelectedItem
End Sub
Private Sub MultiButton_Click(ByVal sender As Object,
ByVal e As System.EventArgs) _
Handles MultiButton.Click
Me.ResultLabel.Text = ""
Me.ResultLabel.Text =
Me.NamesListBox.SelectedItems
///