PRB: Caret Appears Outside Border in Multiline Edit Control

Last reviewed: July 23, 1997
Article ID: Q127153
3.10 WINDOWS kbui kbprb

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SYMPTOMS

If a multiline edit control is created with the WS_HSCROLL and ES_MULTILINE style, the caret may still be visible even when it is scrolled beyond the area of the edit control. For example, if a line is longer than the edit control and the caret is placed at the start of the line, when the the edit is scrolled toward the end of the line, the caret becomes visible outside of the control.

CAUSE

The CS_PARENTDC class style is on the standard edit control to allow Windows version 3.1 edit controls to be compatible with Windows version 3.0 edit controls. This causes this behavior.

RESOLUTION

To avoid this behavior:

  • Give the parent window of the edit control the WS_CLIPCHILDREN style.

    -or-

  • Use a superclass of the edit control with a class style of CS_DBLCLKS. This is different from the standard edit control, which has both the CS_DBLCLKS and CS_PARENTDC class styles set.

NOTE: Neither Windows NT version 3.5 nor Windows 95 exhibit this behavior.


Additional reference words: 3.10
KBCategory: kbui kbprb
KBSubcategory: UsrCtl
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.