Populate ToolStripMenuItem with Directory Files

Use this board to post your code snippets - tips and tricks
1 post Page 1 of 1
Contributors
User avatar
RonaldHarvey
Top Poster
Top Poster
Posts: 113
Joined: Tue Apr 05, 2011 2:32 pm

Hello Coders,

I want to share this handy code, I know this is simple for those experts.
Code: Select all
 Dim dir As New IO.DirectoryInfo("D:\")

        '' Adding the files at Form Load event

        For Each file As IO.FileInfo In dir.GetFiles
            SampleToolStripMenuItem.DropDownItems.Add(file.Name)
        Next 
That's it.

Thanks..
1 post Page 1 of 1
Return to “Quick Snips”