如何在C#windows usercontrol中设置Enabled = false后强制绘制?
使用EnabledChange
UserControl的事件..
private void userControl_EnabledChanged(object sender, EventArgs e)
{
if (! Enabled)
Invalidate(); // ask the control to redraw itself
}
Run Code Online (Sandbox Code Playgroud)
注意:将此代码放在userControl类中,而不是在表单中.祝好运!
归档时间: |
|
查看次数: |
2898 次 |
最近记录: |