I have a simple Winforms multiline TextBox on my Form. Whenever I resize or move the TextBox its content starts to flicker madly. That looks very disgusting and might even cause epileptic seizure for some users ;-)
Is there a way to manipulate the redrawing process of the TextBox to get rid of the flickering?
I've found a working solution on the MSDN forums written by Hans Passant. The following code can be added to the form and will work for all child controls, too:
protected override CreateParams CreateParams {
get {
const int WS_EX_COMPOSITED = 0x02000000;
CreateParams cp = base.CreateParams;
cp.ExStyle |= WS_EX_COMPOSITED;
return cp;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With