Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The enter key and the DirListBox 1

Status
Not open for further replies.

bjwade62

Programmer
Oct 31, 2002
15
US
I want to be able to select a folder in the dirlistbox, then hit the enter key and have it open the folder. I've tried the keydown event but no luck.

Can anyone help?
Thanks,
Bernie
 
Give this a try

Option Explicit
Dim sPath As String

Private Sub Dir1_Click()
sPath = Dir1.List(Dir1.ListIndex)
End Sub

Private Sub Dir1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Dir1.Path = sPath
End Sub

Let me know if this helps. If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]

[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top