Check is control disposed

This commit is contained in:
Jaex 2020-07-29 19:28:08 +03:00
parent f685dd177b
commit 8de52c9737

View file

@ -48,15 +48,23 @@ public ControlHider(Control control, int autoHideTime)
private void Timer_Tick(object sender, EventArgs e) private void Timer_Tick(object sender, EventArgs e)
{ {
timer.Stop(); timer.Stop();
if (Control != null && !Control.IsDisposed)
{
Control.Visible = false; Control.Visible = false;
} }
}
public void Show() public void Show()
{
if (Control != null && !Control.IsDisposed)
{ {
Control.Visible = true; Control.Visible = true;
timer.Stop(); timer.Stop();
timer.Start(); timer.Start();
} }
}
public void Dispose() public void Dispose()
{ {