mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Check is control disposed
This commit is contained in:
parent
f685dd177b
commit
8de52c9737
1 changed files with 12 additions and 4 deletions
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue