Search

Vista Video Glitches Textbox Display (multiline TextBox with scrollbars and transparent Parent doesn't paint correctly) by Bob Cohen

Closed
as Fixed Help for as Fixed

11
0
Sign in
to vote
Type: Bug
ID: 180146
Opened: 8/12/2006 8:41:55 PM
Access Restriction: Public
Duplicates: 180147 250305
1
Workaround(s)
4
User(s) can reproduce this bug
The enclosed app behaves correctly in XP/2003 but misbehaves in Vista.

I have included a minimal app that demonstrates the problem. It has a textbox within a groupbox on a form that has a Paint override.

As you hover your cursor over the textbox you will see the text within it vanish.
-------------------------------------
Add'l: This item still occurs with the current MSDN version of Vista and VS2005/SP1.

Bob Cohen
Details (expand)
Product Language
English
Version
Visual Studio 2005 Professional Edition
Operating System
Windows Server 2003
Operating System Language
English
Category
\Frameworks
Subcategory 1
\Win32
Subcategory 2
\
Subcategory 3
 
Steps to Reproduce
1) Run the enclosed app. Note the text in the textbox.
2) Hover your cursor over the textbox. Note the text disappears.
3) Select the text with your cursor. You can see the text again.
4) Click somewhere outside the textbox. The text disappears.
Actual Results
See above.
Expected Results
Works OK in XP and 2003, but not Vista 5472
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 5/1/2008 at 4:38 PM
Hi!

We have implemented a fix for this issue and it will be available in the next release of the product.

thanks for helping us improve the quality of our product.

Miguel A. Lacouture
[MSFT]
Posted by Bob Cohen on 9/22/2006 at 4:44 PM
I would think that this is _precisely_ a backwards compatibility issue! While admittedly it's not the most common set of conditions, it's not all that unusual either.

Bob Cohen
Posted by Microsoft on 9/22/2006 at 3:50 PM
Thanks for your feedback on the .NET Framework! As you may have seen in DevDiv VP - S. Somasegar’s blog on the topic (http://blogs.msdn.com/somasegar/archive/2006/05/18/601354.aspx) the next release of the .NET Framework (codenamed “Orcas”) requires a high degree of backwards compatibility. As such we are not able to address this issue with a fix in the .NET Framework in the Orcas timeframe. Many customers have found it useful to discuss issues like this in the forums (http://forums.microsoft.com/msdn/default.aspx?siteid=1) where Microsoft and other members of the community can suggest workarounds.

Before we even begin work on the next release of the NET Framework release where we can make changes like this one we will devote time to addressing the top issues (in terms of number of votes, lack of workarounds, etc). So please do continue to vote for this item if it is causing issues.

Thanks and keep the feedback coming.

UIFx Team
Sign in to post a workaround.
Posted by Dave Stringer on 12/4/2007 at 6:18 AM
We have a workaround that our customers use in the .Net framework but it relies on them using our specialized MultilineTextBox which inherits from TextBox which we have been providing for some time.
You could achieve a similar effect by producing your own MultilineTextBox class.

The workaround consists of overriding OnHandleCreated and OnParentChanged and using an interop windows Post Message (for processing delay purposes) to get the MultilineTextBox to rehost itself inside a dynamically created hosting panel which is placed in the control hierarchy where the MultilineTextBox was. The properties Location, Size, Anchor, Dock, TabIndex are propogated up to the hosting panel and the MultilineTextBox is fully docked inside the hosting panel.
The trick is then to ensure the hosting panel has its BackColor set to SystemColors.Control rather than Color.Transparent. This appears to fix the painting bug.

We only perform this wierd operation if we detect Vista, Themes are enabled, and the MultilineTextBox is displaying scrollbars.