Setting focus on a textbox on a form vfp 5.0 
Author Message
 Setting focus on a textbox on a form vfp 5.0

I have a form that was built by a vfp 5.0 wizard with a navigation bar
containing an cmdAdd button. In the click event on the cmdAdd button I put
Books.Type1.SetFocus. I get no errors but focus still remains with the
cmdAdd button after the click.

Thanks
Jim



Tue, 31 Jul 2001 03:00:00 GMT  
 Setting focus on a textbox on a form vfp 5.0
Hi Jim,

Quote:

>I have a form that was built by a vfp 5.0 wizard with a navigation bar
>containing an cmdAdd button. In the click event on the cmdAdd button I put
>Books.Type1.SetFocus. I get no errors but focus still remains with the
>cmdAdd button after the click.

As soon as you put code in a subclass snippet, you completely overwrite the
parent class behavior. First look at the code in the parent cmdAdd and see
what you might need to modify to have it also do what you want. It may be as
simple as:

DODEFAULT()
Thisform.Type1.setfocus()

But I doubt it. Wizard code is generally complicated.

You can use the Supercls utility, available at www.classx.com, to view the
parent class code. If you do not have it yet, I highly recommend that you
get it ASAP. It is an indispensable tool.

Best regards,
Tom



Tue, 31 Jul 2001 03:00:00 GMT  
 Setting focus on a textbox on a form vfp 5.0
Jim,

There is also a bug in VFP 5 that may be biting you. In some circumstances,
setting the focus from a command button will leave the focus rectangle on
the command button, but also put the insertion point in the textbox. In this
case you have to actually click in the textbox to put the focus there.

I believe this was fixed in VFP 6.

David Dunetz
SweetWARE

Quote:

>I have a form that was built by a vfp 5.0 wizard with a navigation bar
>containing an cmdAdd button. In the click event on the cmdAdd button I put
>Books.Type1.SetFocus. I get no errors but focus still remains with the
>cmdAdd button after the click.

>Thanks
>Jim



Wed, 01 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Textbox- Select all when textbox got Focus?

2. Lost Focus Event - Setting Focus

3. Basic form questions Set focus and currency

4. set focus to a form

5. Set focus to form

6. Setting Focus in form

7. runtime exe ( forms focus / no focus)

8. Setting focus on VFP application

9. Newbie to VFP 6 - How to set focus to first field on pageframe

10. VFP 5.0 CHECKBOX SHOWS NO SIGN OF FOCUS?

11. Setting Textbox Alignment in VFP

12. textbox control on forms skipping to next textbox

 

 
Powered by phpBB® Forum Software