之前做的都是asp.net的东西,这次要做个winform的小东西,有几个winform的问题问下大家,谢谢!(1)点击主窗体的那个最小化的按扭即"-",
要使窗体缩小到输入法那里显示成一个小图标,请问这要怎做。(2)最小化后,程序里有一个Timer在按一定频率去保存数据,
我想做一个判断,在某种情况下 将窗体显示出来,同时弹出一个信息框,信息框提示“***”。
比如:intType=1 的情况下,将窗体显示出来,同时弹出一个信息框。
即:
if(intType==1)
{
//窗体显示出来
//弹出提示信息
}请问这要怎么实现啊,请帮忙啊,谢谢!
要使窗体缩小到输入法那里显示成一个小图标,请问这要怎做。
加个notifyIcon
要使窗体缩小到输入法那里显示成一个小图标,请问这要怎做。
加个notifyIcon
如果定义窗体的Resize事件
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = false;
this.ShowInTasck =true;
this.notifyIcon1.Visible = true;
}
}
然后再去设置notifyIcon1的DoubleClick事件
private void notifyIcon1_DoubleClick(object sender, EventArgs e)
{
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
this.notifyIcon1.Visible = false;
}
(2)最小化后,程序里有一个Timer在按一定频率去保存数据,
我想做一个判断,在某种情况下 将窗体显示出来,同时弹出一个信息框,信息框提示“***”。
比如:intType=1 的情况下,将窗体显示出来,同时弹出一个信息框。
即:
if(intType==1)
{
//窗体显示出来
//弹出提示信息
}
设置Timer的Tick事件
if(intType==1)
{
//窗体显示出来 this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
this.notifyIcon1.Visible = false;
//弹出提示信息
MessageBox.Show("***");
}
要使窗体缩小到输入法那里显示成一个小图标,请问这要怎做。
加个notifyIcon
如果定义窗体的Resize事件
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = false;
this.ShowInTasck =true;
this.notifyIcon1.Visible = true;
}
}
改成
(1)点击主窗体的那个最小化的按扭即"-",
要使窗体缩小到输入法那里显示成一个小图标,请问这要怎做。
加个notifyIcon
如果定义窗体的Resize事件
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = false;
this.ShowInTasck =false;
this.notifyIcon1.Visible = true;
}
}
要使窗体缩小到输入法那里显示成一个小图标,请问这要怎做。 //我的主窗体是MainForm, 我定义成这样子,怎么点最小化跟默认的一样啊.没什么变化.
private void MainForm_Resize()
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = false;
this.ShowInTaskbar = false;
this.notifyIcon1.Visible = true;
}
}
要使窗体缩小到输入法那里显示成一个小图标,请问这要怎做。
加个notifyIcon
如果定义窗体的Resize事件
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = false;
this.ShowInTasck =true;
this.notifyIcon1.Visible = true;
}
}
然后再去设置notifyIcon1的DoubleClick事件
private void notifyIcon1_DoubleClick(object sender, EventArgs e)
{
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
this.notifyIcon1.Visible = false;
}
(2)最小化后,程序里有一个Timer在按一定频率去保存数据,
我想做一个判断,在某种情况下 将窗体显示出来,同时弹出一个信息框,信息框提示“***”。
比如:intType=1 的情况下,将窗体显示出来,同时弹出一个信息框。
即:
if(intType==1)
{
//窗体显示出来
//弹出提示信息
}
设置Timer的Tick事件
if(intType==1)
{
//窗体显示出来 this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
this.notifyIcon1.Visible = false;
//弹出提示信息
MessageBox.Show("***");
}
正确
private void MainForm_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Hide();
this.notifyIcon1.Visible = true;
}
}
请问这个具体要怎么写啊,我写成8楼那样子 怎么没效果啊.
-------------------------------------
----------------
(1)点击主窗体的那个最小化的按扭即"-",
要使窗体缩小到输入法那里显示成一个小图标,请问这要怎做。
加个notifyIcon
如果定义窗体的Resize事件
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = false;
this.ShowInTasck =false;
this.notifyIcon1.Visible = true;
}
}