Results 1 to 3 of 3

Thread: Stop user from browsing above a certain folder in DirListBox

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    10

    Stop user from browsing above a certain folder in DirListBox

    Hi,
    We have a DirListBox control in our project.

    Double clicking on a directory or folder will refresh the control with the contents of that folder. (Exactly like browsing the Windows

    Explorer).

    We want to stop the user from browsing above a certain level.

    For example, the current folder is D:\Experiments\2000 where "2000" is the folder corresponding to the current experiment that the user

    has opened.

    The "Experiments" folder contains folders one for each experiment.So it contains folders like "2000","3000", "8000", "9000" etc.

    We want the user to stop browsng the Experiments folder which is like the parent of all sub folders. The user should be able to browse

    only the current experiment folder and all its sub folders.

    Is there a way of stopping the user at a certain level in the DirListBox?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Stop user from browsing above a certain folder in DirListBox

    You just need to re-set the path to your "fixed" path (in the Change event of the DirListbox) if they try to go elsewhere.

    You will probably want to use a variable to store the path, which you can then compare to the left part of Dir.Path.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    10

    Re: Stop user from browsing above a certain folder in DirListBox

    That worked. Thanks !

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