SetFocus problem for a form

SetFocus problem for a form

Post by Pete » Thu, 21 Oct 1999 04:00:00



I have a FoxPro Version 6.0  Optiongroup with Yes or No (which is
created Visible =.F. and Enabled = .F. but made Visible and Enabled if I
make changes to the record).  This option group basically asks me if I
want to archive the old data.  When calling the Yes option with
"THISFORM.OptionGroup1.Yes.SetFocus" I get it (I know this because the
When fires) but it immediately falls out of the option group, back to
the line immediately after the ~.SetFocus call.  I can't click Yes
or No - it doesn't stop to let me.

This used to work a couple of months ago but now is not.  If I create a
fresh new option group, the same occurs.  Could it be something in the
form or something like a SET command/flag that disallows the program to
stop there?  What could be wrong?
TIA.

 
 
 

SetFocus problem for a form

Post by Stefan Wuebb » Fri, 22 Oct 1999 04:00:00


Pete,

This is by design. A running method will not stop for a "SetFocus()".
It would, if you call a modal form.
Or even simpler calling the messagebox() function.
Wouldn't messagebox("Wanna save data?",4+32,_screen.Caption) be an option
for you?

hth
Stefan

  I have a FoxPro Version 6.0  Optiongroup with Yes or No (which is created
Visible =.F. and Enabled = .F. but made Visible and Enabled if I make
changes to the record).  This option group basically asks me if I want to
archive the old data.  When calling the Yes option with
"THISFORM.OptionGroup1.Yes.SetFocus" I get it (I know this because the When
fires) but it immediately falls out of the option group, back to the line
immediately after the ~.SetFocus call.  I can't click Yes
  or No - it doesn't stop to let me.
  This used to work a couple of months ago but now is not.  If I create a
  fresh new option group, the same occurs.  Could it be something in the
  form or something like a SET command/flag that disallows the program to
stop there?  What could be wrong?
  TIA.

 
 
 

1. error messag, This.cmd2.setfocus() calling form 2 form form1

In the valid event of form1 I call form 2 which displays error messages. The
init event of form 2 has code of the form This.cmd2.setfocus() to move cursor
to a default button.  When the valid event of the field in form 1 is called I
get an error message saying that setfocus command cannot be used.  This is
strange since set focus is in init event of form 2.

How the I get around this?  What I am trying to do is display an error
message and stay in the field that caused the error, i.e. when tabbing from
fielda to fieldb display the error message for fielda and and not go to
fieldb but remain in fielda.

2. VB 3-tier and populating grids

3. DBGrid Problem -- SetFocus Limit

4. JOB CNET Decision Support Engineer

5. .LostFocus/.SetFocus problem

6. Relational Database Question - Puzzled...

7. SetFocus problem with Option Groups

8. dynamically building quesries in sp's

9. SetFocus problem with v3.0b

10. Another setfocus problem in VFP 3

11. Problem with SetFocus()

12. Problems with .SetFocus Property

13. FoxPro SetFocus to an Option Group problem