5

I am creating a small app (my first in Delphi 7) which takes several values from the user by TEdit and outputs a view calculations. This is all working.

This app is going to be used on a tablet on a fairly small screen, so I don't want to use Windows' on-screen keyboard. I have created a number pad using several buttons for [0 - 9], [.] and [Del].

My goal is to use the number pad to input values in to the TEdits.

My question is, how do I maintain focus on a TEdit whilst pressing a button that sends a value back to it?

1
  • 1
    Why don't you change the KeyboardType property of your TEdit to NumberPad so that on-screen keyboard will be shown as NumberPad variant instead of recreating the whole on-screen keyboard by yourself? docwiki.embarcadero.com/Libraries/Tokyo/en/… Commented Nov 29, 2018 at 7:37

1 Answer 1

8

Use TSpeedButton instead of TButton. A SpeedButton doesn't take focus while being pressed, so your active Edit will stay focused.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.