Thank you! The code is:
public class TransControl : System.Windows.Forms.Control {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public TransControl() {
// This call is required by the Windows.Forms Form Designer.
base.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.StandardClick |
ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing ) {
if( disposing ) {
}
base.Dispose( disposing );
}
protected override void OnPaint(PaintEventArgs e) {
base.OnPaint (e);
}
protected override void OnPaintBackground(PaintEventArgs pevent) {
//do not allow the background to be painted
}
}
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:ON*************@tk2msftngp13.phx.gbl...
Hi,
To create a double buffered control the styles that you need to turned on
are
SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint
| ControlStyles.UserPaint, true);
All those styles are necesery for double buffering to work and it works
for transparent controls as well.
If you still have ptoblems I'd suggest to post some code(preffered) or
explain how you create that transparent conrol. The problem could be
there.
--
Stoitcho Goutsev (100) [C# MVP]
"°Ë´óɽÈË" <zh**********@hotmail.com> wrote in message
news:OY**************@tk2msftngp13.phx.gbl... HI,
I create a custom transparent control, set the style is
ControlStyles.DoubleBuffer, It display black background. How
to create a double buffer transparent control?