BUG: TransparencyKey does not work for double-buffered controls in 32-bit color mode (820640)
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)
SYMPTOMSYou may have a Microsoft Windows Form with a user control
that has the DoubleBuffer control style bit set to TRUE. Or, you may have a Microsoft
Windows Forms control (such as a Button, a PictureBox, a CheckBox, or a Label)
with the DoubleBuffer property that is automatically set. When you set the TransparencyKey property of the Windows Form to the value of the BackColor property, and then run the application, the Form appears
transparent and the control appears in color.
Note The color is set in the BackColor property of the Windows Form.
Note You must have the display Color quality set to
32-bit color mode.RESOLUTION To resolve this problem in a Microsoft Windows application
with a Windows Forms control, follow these steps:
- Right-click Label1, and then click
Properties.
- In the Properties window, set the
FlatStyle property to System.
- On the Debug menu, click
Start.
You may notice that both the Form and the
Windows Forms control are transparent. This problem is mentioned in the "More
Information" section of this article.
To resolve the problem in a Windows application with a user
control, follow these steps:
- In Solution Explorer, right-click
UserControl1.vb and then click View
Code.
- Replace the existing
SetStyle(ControlStyles.DoubleBuffer,
true) statement with the following statement:
Visual Basic .NET or Visual Basic 2005 Code SetStyle(ControlStyles.DoubleBuffer, False) Visual C# .NET or Visual C# 2005 CodeSetStyle(ControlStyles.DoubleBuffer,false); - On the Debug menu, click
Start.
You may notice that both the Form and the user
control are transparent. This problem is mentioned in the "More Information"
section of this article.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005applies kbvs2005swept kbvs2002sp1sweep kbProperties kb32bitOnly kbstyle kbdisplay kbWindowsForms kbCtrl kbControl kbbug KB820640 kbAudDeveloper |
---|
|