The DirListBox is just a modified version of a standard ListBox control.
Some of the properties work the same..
The Listbox's List property returns the text for a specific item...
Text1.Text = Listbox1.List(0) places the first entry in the listbox into a
textbox.
ListIndex points to the currently selected item in either control so...
Text1.Text = Listbox1.List(Listbox1.ListIndex) places the currently selected
item in the listbox into a textbox..
'Using the With/End With structure,
With ListBox1 'Or Dir1
Text1.Text = .List(.ListIndex)
End With
Quote:
> Thanks Ken. I am trying to understand what the code is doing but I am not
> familiar with the *.List property. Would you mind enlightening me to what
is
> happening in the code you suggested? Specifically the .List(.ListIndex)
> section.
> > 'Normal way... dbl-click
> > Private Sub Dir1_Change()
> > File1.Path = Dir1.Path
> > End Sub
> > 'single click
> > Private Sub Dir1_Click()
> > With Dir1
> > File1.Path = .List(.ListIndex)
> > End With
> > End Sub
> > > I am wanting to change the path of a directory list and consequently a
> > file
> > > list with a single click rather than a double click of Dir1. I have
the
> > > following code to change the file list box and it works. The problem
is
> > > getting Dir1 to change path to the Dir1.ListIndex
> > > Private Sub Dir1_Click()
> > > frmFiles.File1.Path = Dir1.Path
> > > End Sub
> > > Does anyone have any ideas on how to accomplish this. I thought I have
> > seen
> > > it done before but the method may have been different and I can't find
> the
> > > project that I saw it in.
> > > Thanks for any suggestions.
> > > Justin