Hello guys,
I'm writing an MFC application that uses a splitter window - a "windows explorer" application. It is a typical windows explorer style application - it has a Treeview in the left pane for navigation, and a Frame that displays various views at different times in the right hand frame. I have a small usability problem - whenever the user opens a new dialog by interacting with the view displayed in the right hand frame, focus returns to the left hand pane (the treeview), rather than the right Frame which holds the current View, typically a Form View.
This is bad - surely focus should return to where it was lost from when the dialog was given focus - the right pane/ Form View.
I call this code from BOOL CMainFrame::OnCreateClient
(LPCREATES
TRUCT /*lpcs*/, CCreateContext* pContext) :
m_wndSplitter.SetActivePan
e(0, 1) ;
However, this doesn't help, or have any discernible effect. Perhaps I've misunderstood what this method does - according to MSDN documentation-
http://msdn.microsoft.com/en-us/library/52afb8hs(VS.80).aspx , it "sets the pane as active", and "is called by the framework" - I guess that means it is intended that the programmer should provide their own implementation of this virtual function, so they can do house keeping when the right hand pane gets focused by the user, rather than being intended for the programmer to call directly.
Anyway, what should I do to achieve the desired effect of having focus return to the right hand pane?
Regards,
Sternocera
Start Free Trial