|
-
Apr 7th, 2006, 12:14 PM
#1
Re: Outputting to a listbox
I'm a little confused. Do you need to replace the ":" with a "$" so that the end result is C$ instead of C:?
-
Apr 7th, 2006, 12:30 PM
#2
Thread Starter
Registered User
Re: Outputting to a listbox
-
Apr 7th, 2006, 12:38 PM
#3
Re: Outputting to a listbox
Well, there is a couple of ways you can do it.
Lets start with the textbox. You can replace the ":" with "$" in the textbox itself so C: never even gets to your Listbox, which, of the differenant ways, is the one I would recommend.
VB Code:
Private Sub txtLookUp_KeyPress(KeyAscii As Integer)
If KeyAscii = 58 Then KeyAscii = 36 'this will replace : with $ when you are typing
End Sub
-
Apr 7th, 2006, 12:51 PM
#4
Thread Starter
Registered User
Re: Outputting to a listbox
Hack,
I don't think we're on the same page. My listbox displays drive letters (example, C:, D:, G: ). I want to be able to double click the drive letter, and launch an explorer window to that drive on the remote machine. I want to be able to do this by pulling the computer name (for the remote machine) from "txtLookup".
I hope this helps you. I'm sorry I am making this confusing.
Last edited by skakels; Apr 7th, 2006 at 12:58 PM.
-
Apr 7th, 2006, 06:05 PM
#5
Thread Starter
Registered User
Re: Outputting to a listbox
OK, I figured it out. I made the below code and it works well. The only problem is that I had to do it for every letter in the alphabet. If anyone has a shorter way to do it, hit me up. I'd like to see it. Thanks guys for all your help.
VB Code:
If lstDrive = "C:" Then
Shell "explorer " & "\\" & txtLookup & "\C$", vbNormalFocus
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|