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 a script that will open an application in a
I am learning Qt and trying to create application that open documents in tabs
I have an issue with a dialog I'm trying to create in JQuery. It
I'm trying to open a file and create a list with each line read
I am trying create a WCF service that leverages the WPF MediaPlayer on the
Trying to create a user account in a test. But getting a Object reference
Trying to create my first iPhone app that would play back audio. When I
Trying to create a small monitor application that displays current internet usage as percentage
I have a program with a GUI that needs to open a separate window
I'm trying to create a custom view GhostSurfaceCameraView that extends SurfaceView . Here's my

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.