How do I close a view with a button, but leave the document open 
Author Message
 How do I close a view with a button, but leave the document open

Quote:

>I'm writting an MDI application that has two documents.  One of the
>documents has multiple view.  The views are implemented as FormViews.
>Several views for the same document can be open at the same time.  I
>need to be able to close a view with a button.  This leaves the document
>and any other views open.  Close from the system menu, as well as, using
>the 'X' to close works fine.  I want the same functionality, but in a
>button on the form.

>From within the trigger for the button, I've tried to execute the system
>menu close with the following.

>        PostMessage(WM_SYSCOMMAND, SC_CLOSE);

>This has no effect.  I've also tried to call DestroyWindow() and
>OnClose() from the same trigger.  OnClose() does nothing, and
>DestroyWindow() effects the window so it is not redrawn, but is still
>visible.

Get the parent frame for that view and post a WM_CLOSE message to it.

--------------------------------------------------------------------------------


XIOtech Corporation               Personal Home Page:   http://www.*-*-*.com/ ~nde
612-828-5961

"Question authority...and the authorities will end up questioning YOU!"
--------------------------------------------------------------------------------



Sat, 17 Jul 1999 03:00:00 GMT  
 How do I close a view with a button, but leave the document open

I'm writting an MDI application that has two documents.  One of the
documents has multiple view.  The views are implemented as FormViews.
Several views for the same document can be open at the same time.  I
need to be able to close a view with a button.  This leaves the document
and any other views open.  Close from the system menu, as well as, using
the 'X' to close works fine.  I want the same functionality, but in a
button on the form.

From within the trigger for the button, I've tried to execute the system
menu close with the following.

        PostMessage(WM_SYSCOMMAND, SC_CLOSE);

This has no effect.  I've also tried to call DestroyWindow() and
OnClose() from the same trigger.  OnClose() does nothing, and
DestroyWindow() effects the window so it is not redrawn, but is still
visible.

Any ideas?

Thanks,

Wesley J. Dupeire



Sat, 17 Jul 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Keeping open a document after views closed

2. Keeping open a document after views closed

3. close document when close view

4. preventing document from closing when close all views

5. Preventing a document closing when its last view closes

6. use a dialog button to open a doc/view menu (In tree view)

7. Opening/Closing Files (documents)

8. Opening/Closing Files (documents)

9. Opening/Closing Files (documents)

10. Closing a MDI Document/View

11. closing document from view?

12. Closing Multi-views for a Single Document

 

 
Powered by phpBB® Forum Software