Link to home
Start Free TrialLog in
Avatar of elisaac
elisaac

asked on

use object without put component on a form


In fact I want to write code for a list box without putting a component in the form

I use this code but it doesn't work.

Private Sub Command1_Click()
Dim hj As FileListBox
Set hj = New FileListBox

.... my action code there ....


Set hj = Nothing
end sub

Someone can help me ?

Thanks a lot
Avatar of Erick37
Erick37
Flag of United States of America image

See:

"HOWTO: Dynamically Add Controls to a Form with Visual Basic 6.0"
http://support.microsoft.com/support/kb/articles/Q190/6/70.ASP
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wsh2
wsh2

Or.. Add the control to your form.. set it's Visible property to False.. and no one will be the wiser.. <smile>.

If indeed you are just after the Directory control, pay heed to AngelIII's comment and use a File System Object (FSO). There are also APIs that allow you to traverse a Directory path very rapidly.. but at your level, these are much more difficult to code than the FSO.