Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Top Level Form
Message
 
 
To
27/12/2000 18:51:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00457084
Message ID:
00457340
Views:
21
Try adding the code for the SetForegroundWindow API function to the Show method of the form. The instantiation process is Load, Init, Show, Activate and GotFocus (LISAG). When the form internally calls Show or if you do from something else the form will be automatically made the active window in the OS.

See API entry.

As for the Alt hotkeys, do they work if the form has focus. Pressing an Alt key while the form is not active is sending a keyboard message to whatever window happens to be active at the time.

>Ron
>The order was correct. In fact the form worked ok until I put "application=Off" so I could get rid of the VFP window. Now the title bar of the form is dimmed, the menu is dimmed and there is no cursor. To get the cursor all I need to do is click on the mouse anywhere in the form and the cursor appears in the first field. I have tried to set focus which didn't work - stuffed a keyboard command with no sucess. If I take out the "application = off" code I get the Vfp windows and the cursor appears in the first field.
>
>The menu works fine if I click on the menu item. They just don't respond to the Alt-key command.
>
>Any other ideas?
>
>Thanks
>
>
>>Gaylen,
>>
>>I think I can help with the first question. I found this out the hard way...
>>The INIT of a form is a not an active state of the form. In other words, code in the init of the form can't make changes to the form since it hasen't been drawn yet. Make sense? (I tried to put a getfile() in there and it really causes problems.) Anyway, with the form open, go to the menu VIEW and click the Tab Order. Set the control you wan to have focus with the first tab and that should do it.
>>
>>As far as the ALT keys not working, are you sure the controls anr enabled?
>>
>>HTH
>>Ron
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform