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 554411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:42:24+00:00 2026-05-13T11:42:24+00:00

Is there a way to disable the parent windows buttons? I have a working

  • 0

Is there a way to disable the parent windows buttons? I have a “working” form that is called by a lot of forms, that I would like to disable the parent form buttons until it’s finished doing it’s thing. Then turn them back on.

I’d like to do something that is attached to the OnShow event and onClose event.

Thanks

-Brad

  • 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-13T11:42:25+00:00Added an answer on May 13, 2026 at 11:42 am

    Create the form you want to call, as in:

      unit fMyModalForm;
      interface
      uses
        Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
        Dialogs;
      type
        TfrmMyModalForm = class(TForm)
          procedure FormShow(Sender: TObject);
          procedure FormClose(Sender: TObject; var Action: TCloseAction);
        private
          fCallingForm: TForm;
          { Private declarations }
        public
          { Public declarations }
           property CallingForm: TForm read fCallingForm write fCallingForm;
        end;
      (*
      var
        frmMyModalForm: TfrmMyModalForm;
      *)
      implementation
    
      {$R *.dfm}
    
      procedure TfrmMyModalForm.FormShow(Sender: TObject);
      begin
         fCallingForm.Enabled := False;
      end;
    
      procedure TfrmMyModalForm.FormClose(Sender: TObject;
        var Action: TCloseAction);
      begin
         fCallingForm.Enabled := True;
      end;
    
      end.
    

    Then after the button where you want to call this modal form:

      unit fMain;
    
      interface
    
      uses
        Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
        Dialogs, StdCtrls,
        fMyModalForm;
    
      type
        TfrmMain = class(TForm)
          btnCall: TButton;
          btn1: TButton;
          btn2: TButton;
          procedure btnCallClick(Sender: TObject);
        private
          { Private declarations }
            f : TfrmMyModalForm;
        public
          { Public declarations }
        end;
    
      var
        frmMain: TfrmMain;
    
      implementation
    
    
      {$R *.dfm}
    
      procedure TfrmMain.btnCallClick(Sender: TObject);
      begin
         if not Assigned(f)
         then begin
            f := TfrmMyModalForm.Create(Self);
            f.CallingForm := Self;
         end;
         f.Show();
      end;
    
      end.
    

    If you just want to disable all buttons you can iterate through them and in stead of disabling the CallingForm only disable the buttons on the CallingForm. See the Stack Overflow topic (and my answer) at :Cast a form dynamically EDITED: or see answer of _J_ (which basically show the topic).

    I would use actions in stead of buttons though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if there is a way to disable automatic loading
Is there a way to disable the standard built-in function of the Windows-Key (open
Is there any way to disable entire form using jQuery after submission?
Is there a way to disable the affect of CSS like text-transform on text
I have statement $(#myDiv).attr(disabled,disabled); I thought that once I disable parent container, all elements
Is there any way to disable the sound that sounds when a messageBox shows?
I haven't tried that yet, but I assume that I would have to disable
Is there a way to disable changing the value of a ComboBox in WPF
Is there a way to disable the Pending Checkins processing which Visual Studio 2008
Is there any way to disable all input fields in an div container with

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.