Board index » delphi » help: simulating button click

help: simulating button click

How do you simulate a button being clicked so it visually appears to be
depressed?  Using keyboard shortcuts to run the same code as button on
click event, however i want the button to look like it was clicked by
the mouse.  Thanks

Wade  

 

Re:help: simulating button click


Wade Gillingham <wa...@means.net> wrote in article
<69b3he$jm...@news3.mr.net>...

Quote
> How do you simulate a button being clicked so it visually appears to be
> depressed?  Using keyboard shortcuts to run the same code as button on
> click event, however i want the button to look like it was clicked by
> the mouse.  Thanks

try something like...

  sendmessage(button1.handle,BM_SETSTATE,1,0);
  button1.refresh;
  sleep(100);
  sendmessage(button1.handle,BM_SETSTATE,0,0);
  button1.refresh;

--

Angus
ajohn...@rpi.net.au_NO_SPAMS_

Other Threads