I would like to make a combobox that lists all .exe files in the programs directory. Anyone has some source code for me that I could use for that? Thanks,
On the control toolbar, use DriveListBox and FileListBox. All properties and methods are already defined for you. To get an example, go to msdn.microsoft.com and type in drivelistbox
I tried your code and it works to some extend. The problem I still have is that I don't know under what Private Sub I should put your code.
If I put it under Private Sub Combo1_Change() then the combobox stays empty at runtime. Only when you type letters in the combo box there appears a list of exe files. When you type 1 letter the list is there as it should be. When you type 2 letters you get a double list. Etcetera.
When I put the code under Private Sub Combo1_DropDown() a new list of .exe files is added to the previous list every time you click the dropdown button of the combo box, so I get the same .exe files more than once in the combobox.
Sorry - I havn't been in the forum for a long time!
If you still have not resolved your problem, then I would recommend that you put the code in Form.Load. This will ensure that it is populated at the outset.
If you have the code in DropDown or Change, then you WILL get the repeated data as you describe (You could prevent this by having a Combo.Clear at the start of the Sub)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.