Results 1 to 12 of 12

Thread: [RESOLVED] Outputting to a listbox

Hybrid View

  1. #1
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

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

  2. #2

    Thread Starter
    Registered User
    Join Date
    Apr 2006
    Posts
    139

    Re: Outputting to a listbox

    yes sir

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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:
    1. Private Sub txtLookUp_KeyPress(KeyAscii As Integer)
    2. If KeyAscii = 58 Then KeyAscii = 36 'this will replace : with $ when you are typing
    3. End Sub

  4. #4

    Thread Starter
    Registered User
    Join Date
    Apr 2006
    Posts
    139

    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.

  5. #5

    Thread Starter
    Registered User
    Join Date
    Apr 2006
    Posts
    139

    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:
    1. If lstDrive = "C:" Then
    2.         Shell "explorer " & "\\" & txtLookup & "\C$", vbNormalFocus
    3.     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
  •  



Click Here to Expand Forum to Full Width