PRB: AppWizard Generated and CHtmlView Derived Views with Splitter Show Extra ScrollbarsID: Q222143
|
An AppWizard generated MDI/SDI application with the view derived from CHtmlView and with the Splitter Window property set, shows two sets of scrollbars. One set has the horizontal and vertical splitter divider but the scrolling is disabled. The second set has scrolling capability, but is not equipped with the horizontal and vertical splitter divider.
When the Use Split Window property is set using the Advanced button in step 4/6 of AppWizard, the View window is given the capability of horizontal and vertical splitter divider with scrolling disabled.
When the Split window option is selected, the following code is added by AppWizard:
BOOL CChildFrame::OnCreateClient (LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
return m_wndSplitter.Create (this, 2, 2, CSize( 10, 10 ), pContext);
}
The embedded WebBrowser control in the CHtmlView comes equipped with a set of horizontal and vertical scrollbars that allow you to scroll the entire control area.
Currently there is no resolution to this problem.
To work around this problem, remove the implicit splitter window creation styles WS_HSCROLL and WS_VSCROLL; this removes the ChildFrame's scrollbars and also the horizontal and vertical splitter divider. However, the appwizard generated application has a Split command from the Window menu; the framework will take care of handling this command. Choosing Split from the Windows menu, generates a cross-hair, which allows the user to split the window dynamically with one left mouse click.
To remove the scroll bars, edit CChildFrame::OnCreate() as follows:
BOOL CChildFrame::OnCreateClient (LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
return m_wndSplitter.Create (this, 2, 2, CSize( 10, 10 ), pContext, WS_CHILD|WS_VISIBLE|SPLS_DYNAMIC_SPLIT);
}
This behavior is by design.
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Vidyanand N. Rajpathak, Microsoft Corporation
Additional query words:
Keywords : kbMFC kbVC600bug
Version : winnt:6.0
Platform : winnt
Issue type : kbprb
Last Reviewed: April 29, 1999