Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1073233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:58:00+00:00 2026-05-16T20:58:00+00:00

I am trying to create an open dialog (in Windows 7) where the user

  • 0

I am trying to create an open dialog (in Windows 7) where the user is confined to the initial directory. On the open dialog I have set the optionsEX to [ofExNoPlacesBar] and that removes the bar that would let them select folders and directories to go to quickly but the user can use the bread crumb address tool to go up a level and type a different directory into the filename text box to change directories.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:58:00+00:00Added an answer on May 16, 2026 at 8:58 pm

    If you are using Delphi 2009+, there is a TFileOpenDialog. Use this, and set

    procedure TForm3.FileOpenDialog1FolderChange(Sender: TObject);
    begin
      FInitiated := true;
    end;
    
    procedure TForm3.FileOpenDialog1FolderChanging(Sender: TObject;
      var CanChange: Boolean);
    begin
      CanChange := not FInitiated;
    end;
    
    procedure TForm3.btnOpenClick(Sender: TObject);
    begin
      FInitiated := false;
      FileOpenDialog1.DefaultFolder := 'C:\MyFolder\';
      FileOpenDialog1.Execute;
    end;
    

    where

    var
      FInitiated: boolean;
    

    (Notice that there should be exactly one FInitiated per TFileOpenDialog. So, if FileOpenDialog is a private member of TForm3, let FInitiated be a private member of TForm3 as well.)

    To improve the user experience, you will probably use

    procedure TForm3.FileOpenDialog1FolderChanging(Sender: TObject;
      var CanChange: Boolean);
    begin
      CanChange := not FInitiated;
      if not CanChange then beep;
    end;
    

    or

    procedure TForm3.FileOpenDialog1FolderChanging(Sender: TObject;
      var CanChange: Boolean);
    begin
      CanChange := not FInitiated;
      if not CanChange then
        MessageBox(Handle, PChar('Directory selection is not allowed.'), PChar(Caption), MB_ICONINFORMATION);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create an interface of the FileStream.Open method. I have started
I'm trying to create a plug-in to mimic the Eclipse open resource dialog (CTRL+SHIFT+R).
I'm trying to create a function that shows a modal dialog which when called
I've been trying to create my own firefox toolbar with commands that will open
I am trying to create a JQuery dialog that resizes with the window, I
I have an issue with a dialog I'm trying to create in JQuery. It
I have the following code where I'm trying to allow the user to open
I am trying to create a table within PHP code in order to open
I am trying to create a child window in WPF.this child window should open
Trying to create a new Dedicated Cache Role in Windows Azure but get the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.