Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Press a Button by code 1

Status
Not open for further replies.

Gigatech

Programmer
Jul 12, 2000
80
CR
Hi, I use D7. I want to simulate an user click of a SpeedButton by code. If a write:

speedbutton1.click;

the onclick event fires but the button doesn´t change its state. I want to simulate the "visual" effect of pressing the button.

Thanks
 
You could try using the following WindowMessage routines:-

speedbutton1.Perform(WM_LBUTTONDOWN, 0, 0);
speedbutton1.Perform(WM_LBUTTONUP, 0, 0);

which will perform a virtual keypress.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top