[RESOLVED] DirList - select option
Hi
I have a wee app that has a DirList box, a command button and a ListView - basically I select a folder click the button and it's added to a list. This works ok but I'm trying to get a way to have the folder selected without having to open it in the Dirlist (ie it's selected if highlighted) - not sure if it's possible or not.
Cheers in advance
Neil
Re: DirList - select option
You can add anything you want to a listbox, it doesn't have to be loaded from a DirList. Just use something like this:
Re: DirList - select option
Sorry maybe I never explained clearly...I want to be able to know what folder the user has clicked on even if it's just highlighted in the DirList box - at the moment it has to be double clicked to open it before it registers what directory was selected.
Re: DirList - select option
VB Code:
Private Sub Command1_Click()
With Dir1
Text1.Text = .List(.ListIndex)
End With
End Sub
Re: DirList - select option
Quote:
Originally Posted by the_jinj
able to know what folder the user has clicked on even if it's just highlighted in the DirList box
Extending trisuglow's example in the Click event (works):
VB Code:
Option Explicit
Private Sub Dir1_Click()
Me.Caption = Dir1.List(Dir1.ListIndex)
End Sub
Re: DirList - select option
Quote:
Originally Posted by trisuglow
VB Code:
Private Sub Command1_Click()
With Dir1
Text1.Text = .List(.ListIndex)
End With
End Sub
That worked perfectly - thanks :duck: !
Re: DirList - select option
Quote:
Originally Posted by Bruce Fox
Extending trisuglow's example in the Click event (works):
VB Code:
Option Explicit
Private Sub Dir1_Click()
Me.Caption = Dir1.List(Dir1.ListIndex)
End Sub
That works too...thanks :)