C# WinForm如何初始化的时候就自动最小化到右下角的状态栏内。
1个回答
展开全部
public
MainFrm()
{
InitializeComponent();
Thread
th
=
new
Thread(delegate()
{
try
{
this.Invoke(new
MethodInvoker(delegate()
{
this.FormBorderStyle
=
FormBorderStyle.None;
notifyIcon1.Visible
=
true;
this.Hide();
this.FormBorderStyle
=
FormBorderStyle.Sizable;
}));
}
catch
{
try
{
this.Invoke(new
MethodInvoker(delegate()
{
this.FormBorderStyle
=
FormBorderStyle.None;
notifyIcon1.Visible
=
true;
this.Hide();
this.FormBorderStyle
=
FormBorderStyle.Sizable;
}));
}
catch
{
}
}
});
th.Start();
}
}
试试这个
try
和Catch
你可以适当的去掉
其实就是为了怕有时候
窗口句柄
创建过慢
MainFrm()
{
InitializeComponent();
Thread
th
=
new
Thread(delegate()
{
try
{
this.Invoke(new
MethodInvoker(delegate()
{
this.FormBorderStyle
=
FormBorderStyle.None;
notifyIcon1.Visible
=
true;
this.Hide();
this.FormBorderStyle
=
FormBorderStyle.Sizable;
}));
}
catch
{
try
{
this.Invoke(new
MethodInvoker(delegate()
{
this.FormBorderStyle
=
FormBorderStyle.None;
notifyIcon1.Visible
=
true;
this.Hide();
this.FormBorderStyle
=
FormBorderStyle.Sizable;
}));
}
catch
{
}
}
});
th.Start();
}
}
试试这个
try
和Catch
你可以适当的去掉
其实就是为了怕有时候
窗口句柄
创建过慢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询