Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Question regarding DirListBox


Message #1 by Ramesh Sridharan <mr_sriramesh@y...> on Mon, 13 Jan 2003 10:51:20 -0800 (PST)
>From: Ramesh Sridharan <mr_sriramesh@y...>
>Date: Mon, 13 Jan 2003 10:51:20 -0800 (PST)
>
>The DirListBox works like if you "double click" on
>the directory user want and it sets that to its PATH
>property.
>   But my user wants to select the directory in single
>click, though we know in order to select the directory
>double click has to be made, but most of the time user
>misses to double click the control and just selects
>the directory and thinks it does the job he wants..


I had a similar requirement: the user wanted the path to change for a 
SingleClick and also when he pressed the <Enter> key. Put this code in the 
Click() event of the DirListBox control:

         Dir1.Path = Dir1.List(Dir1.ListIndex)

If you also want the <Enter> key to bring about a path change, then trap 
the KeyDown event:

Private Sub Dir1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then

         Dir1.Path = Dir1.List(Dir1.ListIndex)

End If

End Sub



Regards,
-Toby


  Return to Index