BUG: TextBox content is not automatically scrolled to display selected text on receiving focus (820638)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# 2005, Express Edition
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSWhen you programmatically select the content of a text box,
and the selected content resides in the area that you cannot see of the TEXTBOX
control, then the text in the text box does not scroll automatically to display
the selected text. Also, when you move to the TEXTBOX control by pressing TAB,
the selected text does not appear automatically when the text box receives the
focus.WORKAROUNDTo work around this problem, you can use the ScrollToCaret method of the TEXTBOX control. This method scrolls the content of
the control to the current caret position. Copy the following code to
the textBox1_Enter event: Visual Basic CodetextBox1.ScrollToCaret() Visual C# CodetextBox1.ScrollToCaret(); STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbvs2002sp1sweep KbUIDesign kbControl kbWindowsForms kbCtrl kbbug KB820638 kbAudDeveloper |
---|
|