FIX: WebBrowser Control in CFormView Does Not Repaint ProperlyLast reviewed: January 19, 1998Article ID: Q179421 |
The information in this article applies to:
SYMPTOMSWhen you resize the WebBrowser control inside a CFormView, it may not repaint correctly. You may experience the scroll bars not being redrawn.
CAUSEThe WebBrowser control does not handle WM_PAINT messages correctly when it is being resized.
RESOLUTIONWhen the WebBrowser control is resized, update the client area of the WebBrowser control by calling UpdateWindow().
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Microsoft Internet Explorer 4.0.
MORE INFORMATIONThe following code shows how the WebBrowser control would normally be resized when the client window is resized. The call to UpdateWindow() causes a WM_PAINT message to be sent directly to the window of the control.
// CMyFormView is derived from CFormView. // m_browser is a CWnd-derived class that wraps the webbrowser control. void CMyFormView::OnSize(UINT nType, int cx, int cy) { CFormView::OnSize(nType, cx, cy); // Ensure m_browser has valid HWND before doing anything if ( m_browser.GetSafeHwnd() ) { // Resize WebBrowser control to fill the client area m_browser.MoveWindow(0, 0, cx, cy); // Force processing of WM_PAINT m_browser.UpdateWindow(); } } |
Additional query words: web browser shdocvw.dll
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |