Mega Code Archive

 
Categories / Delphi / VCL
 

How to get object focus

Title: How to get object focus Question: How do you get a button to gain focus after tabbing past it without going through all the objects in the tab sequence Answer: I have often found it hard to find answers to very simple tasks that most professional programmers take for granted. I have set out to help the newbies of delphi to take the first step into making Delphi applications Ok to set the focus of a button for example you can put the following line into your program begin ............ button1.setfocus; ............ end; 'Button1' can replaced with any visual component that has a tabstop ability. Goodluck, Martin