主窗体中有做两个处理:
1,主窗体在最小化时,悬浮窗显示
代码:
void MainFormSizeChanged(object sender, EventArgs e)
{
if( this.WindowState == FormWindowState.Minimized )
{
topMostForm.Show();
this.ShowInTaskbar = false;
}
else if( this.WindowState != previouseState )
{
previouseState = this.WindowState;
}
}
{
if( this.WindowState == FormWindowState.Minimized )
{
topMostForm.Show();
this.ShowInTaskbar = false;
}
else if( this.WindowState != previouseState )
{
previouseState = this.WindowState;
}
}