Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Formset focus
Message
 
To
02/09/2005 12:07:49
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01046240
Message ID:
01046285
Views:
16
>
> when i initilised the form in the init event i wrote this.hide
>
> i try your ansewr but make same
>

No, I meant hiding the form that calls the second one

But You also could call the form with the NoShow-Clause
do form frm2.scx noShow name loForm2

....

loForm.Show()
I think, what You want to do is open a second form and directly on the second form set the
focus to, let's say, a textbox. Correct?

So, if You do something like this from within the Commandbutton
do form frm2.scx noShow name loForm2

....

loForm.Show()
loForm.Text1.SetFocus()
You will probably get an error "Can't setfocus from within 'click' or 'valid'" something like that. And that shows Your problem. So what You need to do is to get out of the button's Click-Event and AFTER that do the setfocus() (or activate).

So, what You need to do, is set a flag in the click() that You later check from the Button's LostFocus(). Because from the LostFocus you *can* set Focus to other objects.

Another approach is to employ a timer that fires only ONCE and then does the relocation of the focus. the timer's interval can be something like 20ms. Anything that allows the click to be finished.
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Previous
Reply
Map
View

Click here to load this message in the networking platform