Click here to Skip to main content
15,879,490 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi i create a CDockablePane as well as a CView in the main frame of my application. i need the pane not to get focused. this causes the active view to lose focus and doesn't receive keyboard events anymore. the pane consists of tool boxes. they're dragged into the view. but the pane and its children must not get focus ever.
how can it be achieved? i tried ModifyStyleEx after creation of the pane for setting WS_EX_NOACTIVATE. but it didn't change the pane's behavior. i also tried ModifyStyle to set WS_DISABLED. but it completely disables dragging tools from the pane.
please give me the way.
thx
Posted
Updated 1-May-15 11:23am
v2
Comments
Sergey Alexandrovich Kryukov 1-May-15 18:38pm    
I guess it is because the pane is always non-focusable. You are trying to break through the open door. Only controls which accept focus. You need to understand that "focus" means keyboard focus, and nothing else. Take care about such controls, not the pane. You say "it didn't change the pane's behavior". All right, not describe what is that behavior, and also what behavior you want to achieve.
—SA
ilostmyid2 1-May-15 22:08pm    
Thanks for the answer.
The behavior is that the view loses the focus.
Let me describe in more details. The pane has a title, which changes in color when it's, let's say, activated. Controls in the pane are a tab control and a custom view of type CSrollView which holds the buttons (images which are simply CWnd's). What i want is that the pane and its children can't get focus and can't get activated. For example, now, when i click on the tab control, it gets activated and receives keyboard events and i may change the selected page in the pane by arrow left and arrow right. I want the "view" remain focused, the pane title color don't change and MFC suppose that the pane and its children can't get focused.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900