Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with Top Level Form
Message
From
29/12/2000 20:26:22
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00457084
Message ID:
00458020
Views:
21
Larry
The initial form that comes up is top level and is modeless. A number of the other are modal and operate in the top level. Some of the forms I want to lock the user until they perform a task. If I can't disable the menu they can move to another form by clicking on the menu.

I tried the code _screen.activeform.windowtype = 1 in the skip field in the menu for those menu items I want the menu disabled.

I get an error message when the programs starts which say "activeform is not an object". I have the menu load in the init of the main form which is the first form to instaniate.

In a similar application, I have no problem with that code and the only thing I am doing different is that I am running this as a top level application.

Thanks for any help

Gaylen





>Gaylen,
>
>>Thanks all for your help.
>>
>>I resolved the focus probem by moving the setfocus() to the init of the first field.
>
>I wouldn't recommend this approach (even though it appears to have corrected your problem. The normal instantiation sequence for a form is Load, Control.Init, Init, Show, Activate and GotFocus. If you put a SetFocus in the Init of a control the sequence goes out of whack.
>
>With the code addition above the new sequence is Load, Control Init, Activate, GotFocus, Init and Show.
>
>While this may not be a big deal now, it might bite you in the a$$ later.
>
>>
>>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'm not sure what you mean here. Does VFP throw an error (and if so which one) when you add the skip for clause or does it just not disable to form? Are the forms you are dealing with all top-level? Top-level forms can not be modal. VFP will coerce the WindowType property to Non-Modal (0) even if you set it to Modal (1).
>
>To have the top-level look you can configure the other forms ShowWindow property to 1 - Show in Top-level and also set the Desktop property to .T.. Then you make it modal and the nature of modal forms is to disable menu items.
>
>HTH.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform