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

  • Home
  • SEARCH
  • 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 6336965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:09:40+00:00 2026-05-24T19:09:40+00:00

I have created one application in which Main Form Calls Sub Form on FormShow

  • 0

I have created one application in which Main Form Calls Sub Form on FormShow event of Main Form. Sub Form is displayed and gives two options to choose. If First option on sub form is selected then then a Message is displayed and after that Main form will be displayed. Now when application runs on first time then after option selected on subform Meassage will be displayed. But i want to display message with Main Form as Background. So any solution to this. below is the FormShow code.

Procedure TMainForm.FormShow(Sender:TObject);
begin
  if (SubForm.ShowModal = mrOK) and bOption1 then
  begin
    ShowMessage('Enter the value');
  end;
end;
  • 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-24T19:09:42+00:00Added an answer on May 24, 2026 at 7:09 pm

    If I understand correctly then your problem is that when the message box show up your main form is still invisible.

    If this is the case then you have two options:

    1. Don’t show your SubForm from the OnShow event of the main form, but at a later time
    2. Don’t show the message directly after ShowModal returns, but at a later time

    For point number 2 you can use a similar approach as I suggested here, using PostMessage. So your code would look somethind like this:

    procedure TMainForm.FormShow(Sender:TObject);
    begin
      if (SubForm.ShowModal = mrOK) and bOption1 then
      begin
        PostMessage(Self.Handle, WM_SHOWMYDIALOG, 0, 0);
      end;
    end;
    

    The handler of WM_SHOWMYDIALOG then displays the actual message. This approach can also work for point 1, see ain’s answer.

    PostMessageposts a message to your application’s message queue which will be processed after the main form finished becoming visible.

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

Sidebar

Related Questions

I have created two forms in my Windows Application. One Form acts as a
I have two windows application, one is a windows service which create EventWaitHandle and
I have created a console test application which creates, an object & calls 2
I have a Core Data based application which is built around one main entity.
I have created one application in flex that is accessing the Java webservice using
hello i have created one windows application in c# .net and its working fine
I have created two JavaScript files. One file is "validators.js" and the other is
I have created one WCF service , which is working fine, now i want
I have created an TCPip server application. The application has one global TADOConnection. This
I have created a C# Windows Forms application which I've attempted to make as

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.