Jump to content
Xtreme .Net Talk

Recommended Posts

  • Moderators
Posted

if you want only the selected item...

dim var as string = ListBox1.SelectedItem

 

this will get all selected items...

       Dim nCounter As integer
       Dim s As String

       For nCounter = 0 To ListBox1.Items.Count - 1
           If ListBox1.GetSelected(nCounter) = True Then
               s = s & ListBox1.Items(nCounter)
           End If
       Next
       label1.Text = s

this will get all items, even if they are not selected

       Dim nCounter As Short
       Dim s As String

       For nCounter = 0 To ListBox1.Items.Count - 1
           s = s & ListBox1.Items(nCounter)
       Next
       Label1.Text = s

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...