how to change dir1 path 
Author Message
 how to change dir1 path

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



Fri, 06 Feb 2004 23:22:35 GMT  
 how to change dir1 path

'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


Quote:
> 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



Fri, 06 Feb 2004 23:38:19 GMT  
 how to change dir1 path
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.


Quote:

> '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



Fri, 06 Feb 2004 23:49:50 GMT  
 how to change dir1 path
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



Sat, 07 Feb 2004 01:48:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How do I set path current from dir1 and drive1 objects

2. dir1 directory change with keyboard?

3. Parsing an HTML Document - Change Relative paths to fully qualified paths

4. ? How do you change a path to a dos path name

5. Changing Long Paths to Short Paths in a 16-bit App

6. Passing values selected from Dir1 & File1

7. keypress and dir1?

8. VB Dir1 and File1

9. Enter On Dir1 Box

10. Stuck with Dir1!

11. How to use enter key in Dir1?

12. Change object path

 

 
Powered by phpBB® Forum Software