VB.Net - ListBox

Soldato
Joined
21 Jul 2004
Posts
6,360
Location
Harrow, UK
I have written a really basic program:

Code:
Public Class ***

    Private Sub ***_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        For Each environment As IO.DirectoryInfo In New IO.DirectoryInfo("S:\Bob\").GetDirectories()
            MainList.Items.Add(environment.Name)
        Next

    End Sub

    Private Sub MainList_Doubleclick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MainList.DoubleClick
        MsgBox("lol")
    End Sub
End Class

When I double click on a entry (XYZ) in the list box (MainList), I want to execute a file in:

S:\Bob\XYZ\test\qwerty.123

At the moment, it just outputs a message box saying "lol"

I am not sure how to do this (I am very new to .Net) :(
 
Code:
[COLOR=black][SIZE=2]System.Diagnostics.Process.Start([/SIZE][SIZE=2][SIZE=2]"filename_in_here"[/SIZE][/SIZE][SIZE=2])[/SIZE][/COLOR]

But come on, a Google would have revealed that in seconds!!


How do I use the variable that was selected from the ListBox as part of the path to file that is to be executed?
 
Back
Top Bottom