vb.net get selected items from a listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mastermint
    New Member
    • Oct 2007
    • 1

    vb.net get selected items from a listbox

    i have bounded a listbox to a dataset on load. now i want to get the selected items when a button on the form is clicked,

    cannot use
    [CODE=VB]
    Dim item As ListItem

    For each item in ListBox.Items
    If item.selected Then
    Console.Write(i tem.Text.ToStri ng)
    End If
    Next
    [/CODE]

    because ListItem is not defined
    Please help me to fix this.just want to get the selected items. any other methods are also fine.

    Thanks.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Question moved to .NET Forum.

    Comment

    Working...