Hi,
How to force paint after setting Enabled = false in a C# windows usercontrol ?
Hi,
How to force paint after setting Enabled = false in a C# windows usercontrol ?
If you're talking about WPF UserControl
s, you can just subscribe to the IsEnabledChanged
event of your control and call InvalidateVisual()
in the event handler.
Use EnabledChange
event for the UserControl..
private void userControl_EnabledChanged(object sender, EventArgs e)
{
if (! Enabled)
Invalidate(); // ask the control to redraw itself
}
Note: put this code inside the userControl class, not in the form. Good luck!