How to force paint after setting Enabled = false in Windows C # user control?
Use the EnabledChange event for UserControl ..
EnabledChange
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 on the form. Good luck
If you use winforms:
myControl.Invalidate(); myControl.Update();
If you're talking about WPF UserControl s, you can simply subscribe to your control's IsEnabledChanged event and call InvalidateVisual() in the event handler.
UserControl
IsEnabledChanged
InvalidateVisual()