Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help! Can't close window!
Message
From
05/07/2001 07:50:43
 
 
To
04/07/2001 18:14:54
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00526783
Message ID:
00526878
Views:
13
Hi!

This will work only if your main window is modeless. If it is modal - no way, because child window will lock all other VFP windows until you close it (modal window principle). This happens also when any modal window opened before you main form openeed with this child window - child window will become modal despite parent form is modeless.

You can, of course, use THISFORM.Show() to activate the parent window, then it will be closable and will handle events properly. However, you require focus in that child window to edit the code, that will lock the main window.

If you require that form modal... After MODI COMMAND, you can try to place some control (like a "close" button) in the child window using the reference to the child window object as Sergey suggested (DEFINE WINDOW ... NAME oMyWindowVariable), however, I do not know how it co-behave with the code editor.

Or, make a modal state simulation. Put a timer on form and check if form is active using form's flag. Set flag to .F. (not active) in the deactivate event of the form. Timer when see that form deactivated actiates the form again using SHOW() method of form. Its good idea to us 10ms for timer interval. I did used this approach once to avoid modal form restrictions by using modeless form and do not allow to deactivate it.

HTH.

>Hello
>
>In the form I want display the vfp editor:
>
> lcWindowName="vfpeditor"
> lcfilename = "c:\test.prg"
>
> Define WINDOW (lcWindowName) ;
> FROM lnFromY,lnFromX TO lnSizeY,lnSizeX ;
> FONT "Courier New",10 ;
> DOUBLE;
> IN WINDOW (THISFORM.NAME) ;
> NOCLOSE
>
> Modi COMMAND (lcFileName) ;
> WINDOW (lcWindowName);
> IN WINDOW (THISFORM.Name) ;
> NOWAIT
>
>
>The form displays fine.. but I can't find way to close this window :( hide,release not works Any ideas...
>Thanks
>Denis
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform