ListView-thing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gsb58@hotmail.com

    #1

    ListView-thing

    Hi!

    I'm trying to pass some data to a ListView.

    Can anybody tell what I'm doing wrong?

    Dim strMsg As String
    Dim intTeller As Integer

    Try

    .BeginUpdate()

    intTeller = lstMyList.Selec tedIndices.Coun t - 1

    strMsg = InputBox("Give me words!", "New: " _

    & lstMyList.Selec tedItems(intTel ler).Text _

    & " " & "[index: " &


    lstMyList.Selec tedIndices(intT eller).ToString () _

    & "]", "????")

    lstMyList.Items (intTeller).Sub Items.Add(strMs g)

    .EndUpdate()
    End With

    Catch ..............

    Me.Name

  • Shane Stewart

    #2
    Re: ListView-thing

    You need to add a variable of type ListViewItem
    The following snippet shows adding a list of file names
    from an OpenFileDialog control.

    Dim l_File As String
    Dim l_Files() As String = .FileNames
    Dim l_Item As ListViewItem ' Detail lines
    lvw.BeginUpdate () ' Turn off screen update
    For Each l_File In l_Files
    l_Item = New ListViewItem
    l_Item.Text = l_File
    l_Item.SubItems .Add(STYLE_STRE TCH)
    lvw.Items.Add(l _Item)
    Next
    lvw.EndUpdate()

    Comment

    Working...