Re: Closing forms in Windows95

From: Andrew Tompkins <andrewto_at_kingfish.cse.tek.com>
Date: 1997/06/05
Message-ID: <ANDREWTO.97Jun5085242_at_kingfish.cse.tek.com>#1/1


In article <3395d28b.27855373_at_news.mbnet.mb.ca>   manders_at_access.mbnet.mb.ca (Michael Anderson) writes:

>
> On 3 Jun 1997 12:47:10 -0700, Dan Peacock wrote:
>
> >In article <3392ca1e.1859602_at_news.mbnet.mb.ca>, manders_at_access.mbnet.mb.ca
> >says...
> >>
> >>Is there a way to close a form using the close button of the MDI child
> >>window? If there is, could you tell me?
> >
> >This only works on all but the last child window in the MDI frame, or so I've
> >heard. I haven't tried it yet, but if you only have one child window in the MDI
> >frame, you can't close it using the child's close button.
>
> The close button on the individual MDI child windows (forms) do not
> work! None of them. Does any one know how to make them work?
>

Use a When-Window-Closed trigger with the following code:

DECLARE BEGIN

	Go_Item( <item-outside-window-to-close> );
	Set_Window_Property( <window-name>, VISIBLE, PROPERTY_FALSE );

END; This will close the named window unless it is the last window open. This is because the window containing the cursor control will always be displayed. If you exit the form module through the same block, you can use something like this to close the last window:

DECLARE BEGIN

	IF :SYSTEM.CURSOR_BLOCK = <exit-block> THEN
		Exit_Form;
	ELSE
		Go_Item( <item-outside-window-to-close> );
		Set_Window_Property( <window-name>, VISIBLE, PROPERTY_FALSE );
	END IF;

END; Add your own extras add needed.

--Andy
-- 
-------------------------------------------------------
| Andrew G. Tompkins    | #include <disclaimer.std.h> |
| Software Design Eng.  ------------------------------|
| Tektronix, Inc.                                     |
| Phone: (503) 627-5172      fax: (503) 627-5548      |
| email: Andrew.Tompkins_at_tek.com (work)               |
|        andytom_at_teleport.com (home)                  |
| http://www.teleport.com/~andytom/                   |
-------------------------------------------------------
Received on Thu Jun 05 1997 - 00:00:00 CEST

Original text of this message