If I understood well, try the following :
Suppose your "Cancel" button is named "Button25" and your form "Form1".
At your form's OnShow event, simply add :
Form1.Button25.SetFocus;
That's it.

I don't think that it's logical to have the focus at Button1 and when 
you click it to call another buttons OnClick event.

Regards,
Dimitris Botsis

Victor Fraenckel wrote:
> I am new to the list. I have used  Delphi 7 since its arrival and before 
> that I used Delphi 4 and have been a Pascal programmer since before Turbo 3.
> 
> I have had a plaguing problem for a long time. It goes like this:
> 
> Say I have a form that contains several text boxes and several buttons. 
> The text boxes are at the beginning of the tab order and the form opens 
> with the first text box having the focus. The last button in the tab 
> order is a cancel button. With the focus in the first text box how can 
> the user just click on the cancel button and have the action attached to 
> the buttons OnClick event triggered? I would like to not have to tab 
> through the tab order to get to the cancel button. Is there a way to do 
> this?
> 
> Any enlightenment will be appreciated.
> 
> Vic

Reply via email to