| | | Forum Newbie
       
Group: Forum Members Last Login: 7/31/2008 9:55:14 AM Posts: 6, Visits: 25 |
| | I'm trying to let a user tab from the drivelistbox to the dirlistbox and then the filelistbox. On each of these boxes I want the user to be able to select an item then press the Enter key to update each list. Ex: dir1.refresh drive1.refresh & file.refresh. I can't seem to get the lists to update to my new seletion. with a keypress or keydown event. Only a double click on these lists will refresh the change in paths. Does anyone know how I could do this? Any help would be greatly appreciated. Thanks. |
| | | | 
Forum God
       
Group: Forum Members Last Login: Today @ 9:44:44 AM Posts: 1,446, Visits: 3,307 |
| Welcome to A1vbcode Gkup.  So what isn't happening when you Refresh Drive1, Dir1 and File1? 
Keith http://www.martin2k.co.uk/forums/ I've been programming with VB for 12 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning. |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 7/31/2008 9:55:14 AM Posts: 6, Visits: 25 |
| | When I use arrow up or down keys in the drivelistbox the dirlistbox gets updated. When I tab over to the dirlistbox and use the arrow keys to move to a direrent directory, the filelistbox will not update. I would like to be able to arrow up or down to the directory I want then press Enter on the keyboard and have the filelistbox updated to that directory. Then tab over to the filelistbox and open the file by pressing Enter on the keyboard. When I place dir1.refresh in the keypress code it does nothing. Any idea what I'm doing wrong? Thanks for your help. |
| | | | 
Forum God
       
Group: Forum Members Last Login: Today @ 9:44:44 AM Posts: 1,446, Visits: 3,307 |
| Gkup (5/9/2008) When I tab over to the dirlistbox and use the arrow keys to move to a direrent directory, the filelistbox will not update.Try.  Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path File1.Refresh
End Sub
Keithhttp://www.martin2k.co.uk/forums/ I've been programming with VB for 12 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning. |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 7/31/2008 9:55:14 AM Posts: 6, Visits: 25 |
| | That is identical to the code I have. I don't understand why this doesn't work. I even pasted your code on top of mine just to make sure I wasn't missing something. I'm baffled at this point (although that's not hard to do for me). The file list should be updating the new directory path, but it's just not working. Any other ideas? Could a timer with an interval of 1 be messing it up by not allowing it to refresh fast enough? Thanks again for all your help. This forum is the best. |
| | | | 
Forum God
       
Group: Forum Members Last Login: Today @ 9:44:44 AM Posts: 1,446, Visits: 3,307 |
| Gkup (5/9/2008) Could a timer with an interval of 1 be messing it up by not allowing it to refresh fast enough?You didn't mension a Timer so what does this Timer do? 
Keith http://www.martin2k.co.uk/forums/ I've been programming with VB for 12 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning. |
| | | | 
Forum God
       
Group: Forum Members Last Login: Today @ 8:29:37 AM Posts: 301, Visits: 1,560 |
| Keithuk (5/10/2008)
Gkup (5/9/2008) Could a timer with an interval of 1 be messing it up by not allowing it to refresh fast enough?You didn't mension a Timer so what does this Timer do?  Keith, I was perfectly content with double clicking the Dir list item to change a directory until I read Gkup's post. I was about to give up trying until I tried this: Eureka!  Private Sub Dir1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then 'Enable Enter key to change Dir Dir1.Path = Dir1.List(Dir1.ListIndex) End If End Sub
I think Gkup has put the Dir.Refresh method in a Timer? Dunno why though!
"So much to learn. So little time to do it. Wise men know it's later than one thinks"! ***Vote here to make Keith a Moderator*** http://www.a1vbcode.com/vbforums/FindPost23630.aspx |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 7/31/2008 9:55:14 AM Posts: 6, Visits: 25 |
| | That did it. Thank you very much guys. I love this forum. You rock! |
| | | | 
Forum God
       
Group: Forum Members Last Login: Today @ 8:29:37 AM Posts: 301, Visits: 1,560 |
| Gkup (5/10/2008) That did it. Thank you very much guys. I love this forum. You rock!You're welcome! 
"So much to learn. So little time to do it. Wise men know it's later than one thinks"! ***Vote here to make Keith a Moderator*** http://www.a1vbcode.com/vbforums/FindPost23630.aspx |
| |
|
|