I have this as code to run the program
Which used to work but then I added a "Preview image" function like this :Code:Process.Start(ListBox1.SelectedItem.ToString.Split(New String() {" "}, StringSplitOptions.None)(1))
I now discovered that the first code is useless, because it selects everything after " " to run, including the "Image:"Code:(ListBox1.SelectedItem.ToString.Split(New String() {" Image:"}, StringSplitOptions.None)(1))
This is how a listbox item is stored:
As you can see it'll use thisCode:Tomb Raider Level Editor - Original C:\Program Files\Tomb Raider - Level Editor\tomb4.exe Image:C:\Program Files\Tomb Raider - Level Editor\load.bmp
to runCode:C:\Program Files\Tomb Raider - Level Editor\tomb4.exe Image:C:\Program Files\Tomb Raider - Level Editor\load.bmp
Is there any way I can make it choose the path from " " and when it finds "image:" it stops?


Reply With Quote
