[Code] Filling ComboBox/ListBox with every exe inside the application folder[Solved]

Posts 1–5 of 5 · Page 1 of 1
[Code] Filling ComboBox/ListBox with every exe inside the application folder[Solved]
i want some codes to populate a listbox/comx with all the names of the exe inside the application folder i am going to make.

i want to make an application that gets the list of exes and put it in the listbox/comx, and when i select the exe it will start,

the only thing i need now is the codes to populate the said list.

is it possible, or im just being crazy chooby again?
[highlight=vb.net]
Dim exeArray As String() = FileIO.FileSystem.GetFiles(Application.StartupPath , 2, "*.exe").ToArray

ComboBox1.Items.AddRange(exeArray)
ListBox1.Items.AddRange(exeArray)
[/highlight]

Yeah, you can call the AddRange method on either of the controls and it will parse an array and add each individual item.
imports system.io

for each file in dir(directory here)
combo.box.items.add(file)
next

Sub combo.box clicked item BLAH BLAH BLAH...
if e.name = "name here" then
do this
elseif e.name = "other name here" then
do this
end if
end sub



i dont have visual basic in front of me so i cant tell you exactly...
thank you, problem solved
Marked solved. No need to post further.
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Tags

None

Talk with us