Microsoft KB Archive/222143

= PRB: AppWizard Generated and CHtmlView Derived Views with Splitter Show Extra Scrollbars =

Article ID: 222143

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Standard Edition 

-

<div class="notice_section">

This article was previously published under Q222143

<div class="symptoms_section">

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.

<div class="cause_section">

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.

<div class="resolution_section">

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); }

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

Steps to Reproduce Behavior

 * 1) Create a default MFC application using AppWizard.
 * 2) At step 4/6 click the Advanced.
 * 3) Select Use Split Window on the Window Style tab.
 * 4) At step 6/6 select the base class as CHtmlView.
 * 5) Build and Run the application.

Notice that the View window is equipped with two sets of scrollbars. One set is disabled and has the splitter divider, and other set allows the embedded control to be scrolled.

Keywords: kbbug kbdocview kbnoupdate kbprb kbuidesign KB222143

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.