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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:56:36+00:00 2026-05-21T21:56:36+00:00

I need a built-in on screen numeric keypad in my Application. For various reasons

  • 0

I need a built-in on screen numeric keypad in my Application. For various reasons I cannot use the TMS Software or other commercial component offerings. I’m very happy with a button-based solution shown below but I cannot yet see how to solve the focus switch issue where clicking the button activates the keypad form and I lose the focused control into which I wanted the characters. My solution works if I keep the keypad buttons within the target form but I would like a form-independent solution. Is there a way of disabling the button activation or knowing where the focus came from so that I can use something like Scree.ActiveControl :=?? to put it back?

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-21T21:56:37+00:00Added an answer on May 21, 2026 at 9:56 pm

    I don’t know how to create window with the frame which is unfocusable when you click it, so the following one is without border. And as Andreas mentioned, use TSpeedButtons.

    type
      TKeypadForm = class(TForm)
        SpeedButton1: TSpeedButton;
        procedure SpeedButton1Click(Sender: TObject);
      private
        procedure CreateParams(var Params: TCreateParams); override;
        procedure WMMouseActivate(var Message: TWMMouseActivate); message WM_MOUSEACTIVATE;
      end;
    
    procedure TKeypadForm.CreateParams(var Params: TCreateParams);
    begin
      inherited CreateParams(Params);
      Params.Style := WS_POPUP or WS_THICKFRAME;
    end;
    
    procedure TKeypadForm.WMMouseActivate(var Message: TWMMouseActivate);
    begin
      Message.Result := MA_NOACTIVATE;
    end;
    
    procedure TKeypadForm.SpeedButton1Click(Sender: TObject);
    begin
      PostMessage(GetFocus, WM_KEYDOWN, VK_NUMPAD1, MakeLong(0, MapVirtualKey(VK_NUMPAD1, 0)));
    end;
    

    And here’s how to show the keypad window

    procedure TForm18.Edit1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      case Key of
        VK_RETURN: ShowWindow(KeypadForm.Handle, SW_SHOWNOACTIVATE);
        VK_ESCAPE: ShowWindow(KeypadForm.Handle, SW_HIDE);
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add user roles and permission system into my web application built
I need to build an assembler for a CPU architecture that I've built. The
Do I need to create my own InvalidArgumentException.. I couldn't find any built-in types
Is there some sort of built-in authentication in WCF? I need to expose a
Explanation: Say package A is always built first and then package B. I need
I need to build a simple, single user database application for Windows. Main requirements
We need to build an administration portal website to support our client/server application. Since
I need to create a Web-based Dashboard tool for a LOB application. Essentially users
For an iPhone ebook application I need to break arbitrarily long HTML documents up
I'm in a bit of a pickle. I need to generate charts (off screen

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.