Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Top Level Form
Message
From
29/12/2000 11:37:13
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00457084
Message ID:
00457805
Views:
25
Thanks all for your help.

I resolved the focus probem by moving the setfocus() to the init of the first field.

I got the alt keys to work with the top level menu by creating another top level form and it works fine. It didn't like something in the old form. I don't know why, but it works now.

I am having a problem with the menu however. I want the menu disabled when I am on a modal form. I have always use _screen.activeform..... in the skip for field to check to see if it is a modal form and it worked. With the top level screen it doesn't like the command. I tried removing the _screen but it doesn't recognize activeform.


I like the looks of a top level application, but I am not sure it is worth the aggrevation.

Any Suggestions

Thanks
Gaylen
PS. if this is a repeat please disregard as I tried to send it earlier and had a connection problem.




>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform