PRB: AppWizard Generated and CHtmlView Derived Views with Splitter Show Extra Scrollbars (222143)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q222143 SYMPTOMS
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.
CAUSE
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.
The default behavior for the dynamic splitter window is to create horizontal and vertical scrollbars associated with the view panes.
RESOLUTION
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);
}
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 12/11/2003 |
---|
Keywords: | kbBug kbDocView kbNoUpdate kbprb KbUIDesign KB222143 |
---|
|