Results 1 to 2 of 2

Thread: Listview

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    1

    Red face Listview

    Hello,

    I´m kind of stock on two things I wanna do with my listview. I want to view all files from different folders on the same listview. I Know I have to add the 2 file arrays containing my files from each forder, nut how do i add them? Another question is how do i pick a file and open that file just by clicking on it in listview... If someone could help me on this i would really be grateful, thanks in advance,

    Wave397

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Listview

    Quote Originally Posted by wave397
    Hello,

    I´m kind of stock on two things I wanna do with my listview. I want to view all files from different folders on the same listview. I Know I have to add the 2 file arrays containing my files from each forder, nut how do i add them? Another question is how do i pick a file and open that file just by clicking on it in listview... If someone could help me on this i would really be grateful, thanks in advance,

    Wave397
    Hi,

    You could try this;

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim ListItem1 As ListViewItem
    3.         ListItem1 = ListView1.Items.Add("Item 1")
    4.         ListItem1 = ListView1.Items.Add("Item 2")
    5.     End Sub
    6.    
    7.     Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
    8.         If ListView1.SelectedIndices.Count > 0 Then
    9.             TextBox1.Text = "You selected item " & (ListView1.SelectedIndices(0) + 1)
    10.         End If
    11.     End Sub

    Hope it's a start,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width