Results 1 to 19 of 19

Thread: [RESOLVED] List Box

Threaded View

  1. #5

    Thread Starter
    Member
    Join Date
    Mar 2010
    Posts
    33

    Re: List Box

    Reply to #3
    tech & wierd

    This is my code now, I think I am missing a step? You mentioned "Once the items have been loaded"

    I am not sure that I have loaded anything because my list box is still empty. So I can assume now that the original code posted above is just a browse function, the code you gave me is a list function, now I must figure out how to load the desired files. Makes sense. (but I don't know how to load items?) I will search the forum for how to load items and hopefully check back for maybe a reply on how to load items at a later time. hint, hint.

    Thanks


    Code:
    Public Class Form1
    
    
        Private Sub BtBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            Dim BtBrowse As New FolderBrowserDialog()
    
            BtBrowse.SelectedPath = "C:\"
    
            If BtBrowse.ShowDialog() = Windows.Forms.DialogResult.OK Then
    
                For Each File As String In My.Computer.FileSystem.GetFiles(BtBrowse.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly, "*.txt")
                    ListBox1.Items.Add(File)
                Next
    
            End If
    
        End Sub
    
    End Class
    Last edited by VB_begginer; Mar 26th, 2010 at 04:58 PM.

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