• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Enable/Disable A Window in SplitView :: MFC

kuphryn

Senior member
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

 
There is no such thing as a "disabled" view. Well, I suppose it's possible to do, but it is not standard. As far as adding/removing views dynamically, it will involve some book-keeping.

Try the following articles:

Switching Views
Dynamic Views
 
If a view can have a Window handle, it can be disabled.

No mouse or keyboard messages will then be processed to it.
 
Thanks.

Oh. You brought up a topic I have wondered about too.

How do you disable a view especially ignoring keyboard messages?

Kuphryn
 
"Disabling" a view is meaningless. It serves no purpose. If you get to a situation that this needs to be done, then the program design is wrong. Off the top of my head, I can't think of any instances where you may want to disable a view.

When you disable dialog controls, the user can see that they are disabled just by looking at them. However, there is no such standard on how to represent disabled views (visually) - simply because it is not done.
 
To ignore keyboard, just trap the message WM_CHAR or WM_KEYDOWN and check a flag if you wish Windows to handle the message or ignore it.
 
Back
Top