Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

How to simulate key down under Delphi FMX

$
0
0

 how to simulate key down

  var Key: Word;  KeyChar: Char;

 begin

   // under FMX how to simulate key down

    // input '-' to Edit1

    Edit1.SetFocus;

    key:=0;

    KeyChar:='-';

    if Assigned(Focused) then

       Focused.KeyDown(Key, KeyChar, []);

 

    // input '-' to TNumberBox

    NumberBox1.SetFocus;

    key:=0;

    KeyChar:='-';

    NumberBox1.SelectAll;  // in order to replace current value 0

    if Assigned(Focused) then

       Focused.KeyDown(Key, KeyChar, []);

//    // Click / press CornerButton3

//    CornerButton3.SetFocus;

//    key:=vkReturn;

//    KeyChar:=#0;

//    if Assigned(Focused) then

//       Focused.KeyDown(Key, KeyChar, []);

 


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>