WinForms控件在更改大小时闪烁

WinForms控件在更改大小时闪烁,winforms,telerik,flicker,Winforms,Telerik,Flicker,一般来说,这是关于Telerik RadDesktopAlert的 它的控件名为Popup 因此,当我将大小设置为新值时: _textBox.Clear(); _textBox.Text = txtMessage; _textBox.Visible = _btnCollapse.Enabled = _btnNotify.Enabled = _panelWithButtons.Visible = true;

一般来说,这是关于Telerik RadDesktopAlert的 它的控件名为Popup

因此,当我将大小设置为新值时:

_textBox.Clear();
        _textBox.Text = txtMessage;

        _textBox.Visible = 
        _btnCollapse.Enabled = 
        _btnNotify.Enabled =
        _panelWithButtons.Visible = true;

        AlertControl.FixedSize = new Size(ALERT_WIDTH, _height);
        AlertControl.Popup.Size = AlertControl.FixedSize;
我当时试着跑

AlertControl.Popup.Invalidate();
但它仍然闪烁。 我试图通过反射设置双缓冲,但这没有帮助

换句话说,当我为控件设置大小时,如何消除闪烁


PS如您所知,我无法从弹出窗口继承。

我没有任何表单,我无法覆盖第三方控制和无法继承。您是否只是抛出了条款?我认为在WinForms中调整控件大小时,当它们重新绘制自己时,会出现一些闪烁;这就是野兽的本性。您可以尝试尽可能优化效果,也可以使用WPF。值得一提的是,我尝试了您的部分代码,尽管DesktopAlert不断调整大小,但没有明显或长时间的闪烁。