Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15655

How to get combo box to show .exe files and not full path

$
0
0
Apologies in advance I am very new to all this and working on my first project. I am trying to get the exe filename only to show and not the full path to it. for example doom.exe. Thanks in advance.

This is what I have so far

Code:

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Dim directory = "D:\Steam Library"
        Dim files() As System.IO.FileInfo
        Dim dirinfo As New System.IO.DirectoryInfo(directory)
        files = dirinfo.GetFiles("*.exe", IO.SearchOption.AllDirectories)

        For Each file In files
            cmbSelectGame.Items.Add(file)


        Next

    End Sub


Viewing all articles
Browse latest Browse all 15655

Trending Articles