>I have a form with two textboxes (Text1 & Text2) and two commandbuttons (Command1 & Command2). Set the tab order to the following: Command1, Text1, Command2, Text2. Set the enabled property for Text2 and Command2 to .F.. I have the following code in the Click event of Command1:
> THISFORM.Text2.Enabled = .T.
> THISFORM.Text1.Enabled = .F.
> THISFORM.Command2.Enabled = .T.
> THISFORM.Command1.Enabled = .F.
> THISFORM.Text2.SetFocus()
>
>When I run this form and press the Command1 button the focus jumps to the command2 button. However, when I step through the code in the trace window it seems to work ok.
>
>Any ideas?
The Debug tools can cause problems because they can gain focus while the object of interest loses focus (lost focus methods can fire). Remember if you want to completely control the action of a button (for example) you must 'kill' it's default behaviour. This is done with the NODEFAULT clause.
Tom