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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:41:30+00:00 2026-05-14T07:41:30+00:00

I have an app that opens a non-modal form from the main form. The

  • 0

I have an app that opens a non-modal form from the main form. The non-modal form has a TMemo on it. The main form menu uses “space” as one of its accelerator characters.

When the non-modal form is open and the memo has focus, every time I try to enter a space into the memo on the non-modal form, the main form event for the “space” shortcut fires!

I have tried turning MainForm.KeyPreview := false while the other form is open but no dice.

Any ideas?

  • 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-14T07:41:30+00:00Added an answer on May 14, 2026 at 7:41 am

    Disable the menu item on the main form while the memo has focus, and re-enable it when the memo loses it. You can do this from the TMemo.OnEnter and TMemo.OnExit events.

    procedure TOtherForm.Memo1Enter(Sender: TObject);
    begin
      if Application.MainForm is TYourMainForm then
        TYourMainForm(Application.MainForm).MenuItemWithSpace. Enabled := False;
    end;
    
    procedure TOtherForm.Memo1Exit(Sender: TObject);
    begin
      if Application.MainForm is TYourMainForm then
        TYourMainForm(Application.MainForm).MenuItemWithSpace. Enabled := True;
    end;
    

    The use of Application.MainForm and the typecast are to prevent hard-coding in a form variable name in the child form.

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

Sidebar

Related Questions

In our app we have a form that can be opened up non-modally. We
I have a SWT app that opens a OpenGL window (using the LWJGL library)
I have an ASP.NET MVC app that opens a Request view in a new
I have an app that display's the current time when a page opens. I
I'm hearing that is better to have one connection open upon app start up
Have an app that has listings - think classified ads - and each listing
I have a Delphi 2006 app that pops up a modal alert dialog when
I have a customer that has an old non-existant application; he had a problem
I have a multi-threaded Cocoa app that processes images. The program has a progress
Lets assume you have a app that opens a socket port for communication purposes.

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.