Results 1 to 8 of 8

Thread: [RESOLVED] Path location problem Dir.path

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Resolved [RESOLVED] Path location problem Dir.path

    I have problem here.. i have textbox that store path location. It show in the textbox as C:\\ . How I can show in the textbox as C:\ ?

    Dir1.Path = Text1.Text

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: Path location problem Dir.path

    you post is not clear. Do you want whatever path typed in the textbox to become the path for the Dirlistbox? if so you can use
    Code:
    Private Sub Text1_Change()
      On Error Resume Next
      Me.Dir1.Path = Me.Text1.Text
    End Sub
    Note use of On Error Resume Next is not recommended. I've used it just to show you the usage..

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Path location problem Dir.path

    Drivelistbox does't change. How to change the drivelistbox?

  4. #4
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Exclamation Re: Path location problem Dir.path

    Quote Originally Posted by matrik02
    Drivelistbox does't change. How to change the drivelistbox?
    change with what???
    there are various events under which the changes can be coded to happen (say click, double click, got focus,lost focus etc)

  5. #5
    Addicted Member
    Join Date
    Jul 2007
    Posts
    146

    Re: Path location problem Dir.path

    Quote Originally Posted by matrik02
    I have problem here.. i have textbox that store path location. It show in the textbox as C:\\ . How I can show in the textbox as C:\ ?

    Dir1.Path = Text1.Text
    Matrik02,

    Where does this C:\\ come from? If you turn your statement around, Text1.Text = Dir1.Path you will never get a double slash... So where do you get the text displayed in Text1?
    Jottum™
    XpVistaControls , (transparent) usercontrols for XP, Vista and 7 with W2K legacy support.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Path location problem Dir.path

    Quote Originally Posted by Jottum
    Matrik02,

    Where does this C:\\ come from? If you turn your statement around, Text1.Text = Dir1.Path you will never get a double slash... So where do you get the text displayed in Text1?
    A'a I found it, I have code on this. In the textbox show D:\Project, but why my drivelistbox show C: drive? How to change this to D: ?I only have this code only

    Code:
    Dir1.Path = Text1.Text

  7. #7
    Addicted Member
    Join Date
    Jul 2007
    Posts
    146

    Re: Path location problem Dir.path

    Quote Originally Posted by matrik02
    A'a I found it, I have code on this. In the textbox show D:\Project, but why my drivelistbox show C: drive? How to change this to D: ?I only have this code only

    Code:
    Dir1.Path = Text1.Text
    There's also a Drive listbox, you can use them together;

    vb Code:
    1. Dir1.path = Drive1.Drive

    will get you to the root of the drive you've selected in Drive1
    Jottum™
    XpVistaControls , (transparent) usercontrols for XP, Vista and 7 with W2K legacy support.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: Path location problem Dir.path

    I have fix this, here it is

    Code:
    Private Sub Command1_Click()
    Dir1.Path = Text1.Text
    Drive1.Drive = Text1.Text
    End Sub
    
    Private Sub Form_Load()
    Text1.Text = "D:\career"
    End Sub

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