Archived

This topic is now archived and is closed to further replies.

kuphryn

Enable/Disable A Window in SplitView :: MFC

Recommended Posts

kuphryn    210
Hi. I would like to know how to enable/disable a specific view inside a split window. For example, let there the split window comes default with three visible windows. ----- View1 ----- View2 ----- View3 ----- If the user select an option in the menu to hide view2 or maybe a calculated needs to disable view2, is there a way to do that in MFC? Most important that is the entire window must be redrawn. I am not sure how to redraw multiviews inside of main in SDI architecture. Thanks, Kuphryn

Share this post


Link to post
Share on other sites
JTAnderson    196
I just got done messing with this stuff for my tools.

Check out this:

http://codeguru.com/splitter/show_hide_static_panes.shtml

Read the comments below because there are some enhancements people suggest. But this should do what you need.

-JT

Share this post


Link to post
Share on other sites
felisandria    739
Unfortunately trying to show/hide panes of a splitter is pure torture... I agree Microsoft should have put something in there to make it easier.

One thing I''ve done on dynamic/docking splitters to make it slightly easier is to do a resize rather than an actual hide. That''s a lot faster than all the resetting that CodeGuru does, but it has a somewhat unfortunate side effect, namely that when you resize you will have a very small artifact from the original window that''s about a pixel wide because you can''t set a window width negative or zero and expect it to be happy about that.

-fel

Share this post


Link to post
Share on other sites
kuphryn    210
Thanks.

Resizing a view its the minimum possible is one alternative. Right now, I think it is the best solution without over complicating it.

Kuphryn

Share this post


Link to post
Share on other sites