Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Button OnClick to input values in to a TEdit

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?

like image 733
user3292391 Avatar asked Nov 28 '18 10:11

user3292391


1 Answers

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

like image 59
Miamy Avatar answered Nov 15 '22 07:11

Miamy