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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:53:15+00:00 2026-05-27T17:53:15+00:00

hey im working on delphi 7, and i have a scenario for a available

  • 0

hey im working on delphi 7,
and i have a scenario for a available form,
i have two forms

  1. FormOne 
  2. FormTwo

FormOne has a button

enter image description here

which create the FormTwo on button click

    var
     Form2:TForm2;
      begin
       Form2:=TForm2.Create(nil);
       Form2.ShowModal ;
        Form2.Free;
     end;

On Form2 there is a button which i need to disable..(on some conditions)..
enter image description here

so on activate of Form2 i did this

       if assigned(Form2) then
        begin
         Form2.Button1.Enabled:=False;
        end;

that is im checking if the form is created then disable the button..
since the code is in Onactivate meaning the form2 is already created according to this the delphi form liyfe cyle is

OnCreate -> OnShow -> OnActivate -> OnPaint -> OnResize -> OnPaint

..so the button1 should be disabled..but it NOT disabled.

enter image description here

  • 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-27T17:53:16+00:00Added an answer on May 27, 2026 at 5:53 pm

    I guess Form2 is a local variable in your button click handler; in your OnActivate handler your are testing a global Form2 variable from the unit where TForm2 is defined; the second is not assigned if TForm2 is not autocreated form.

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

Sidebar

Related Questions

Hey guys I have the following code working which is sending a GET Request
Hey so I have been working on a project that I want to be
* *Hey i was working on an application which converts any basenumber like (2,8,10,16,etc)
Hey so I have test program for something I'm working on. What does it
Hey guys... I'm working on creating one of my first websites and currently have
hey ive been working with GLM and i have been noticing that im not
Hey m working on one app .. Which is already on App store ..
Hey guys so I've got a working Timer, which will stop() when I call
Hey all, I was working on a recursive generator to create the fixed integer
Hey all, have been working on designing a new database for work. They have

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.