Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Visual Basic (VB 4/5/6) » General Visual Basic » Dir1.refresh and File1.refresh using a...


Dir1.refresh and File1.refresh using a...Expand / Collapse
Author
Message
Posted 5/8/2008 10:00:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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. 
Post #24848
Posted 5/8/2008 3:47:03 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum 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.
Post #24854
Posted 5/9/2008 11:14:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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.

Post #24859
Posted 5/9/2008 8:23:37 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum 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


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.
Post #24864
Posted 5/9/2008 9:36:08 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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.
Post #24865
Posted 5/10/2008 8:39:38 AM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum 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.
Post #24867
Posted 5/10/2008 9:38:25 AM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum 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

Post #24868
Posted 5/10/2008 9:53:56 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum 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!
Post #24869
Posted 5/10/2008 11:11:47 AM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum 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

Post #24871
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Brian, Peter

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 10:29am