如何让窗口最小化到系统托盘(右下角的小图标)???

解决方案 »

  1.   

    这个很简单,在一个事件中设置: this.Visible = false;
    this.ShowInTaskbar = false;
    即可.
      

  2.   

    有个NotifyIcon组件,所见即所得。
      

  3.   

    private void Form1_SizeChanged(object sender, System.EventArgs e)
    {
    NotifyIcon组件
    if(this.WindowState==System.Windows.Forms.FormWindowState.Minimized)
    {
    this.Hide();
    this.notifyIcon1.Visible=true;
    }


    }private void notifyIcon1_Click(object sender, System.EventArgs e)
    {
    if(this.WindowState==System.Windows.Forms.FormWindowState.Minimized)
    {
    this.Visible=true;
    this.WindowState=System.Windows.Forms.FormWindowState.Normal;
    this.notifyIcon1.Visible=false;
    }
    }
      

  4.   

    关闭程序:this.Close();或Application.Exit();
      

  5.   

    呵呵~~
    基本看明白。。主要是this那些让我糊涂了
      

  6.   

    C#编写最小化时隐藏为任务栏图标的Window appllication. 
    1.设置窗体属性showinTask=false2.加notifyicon控件notifyIcon1,为控件notifyIcon1的属性Icon添加一个icon图标。3.添加窗体最小化事件(首先需要添加事件引用):// this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged);//上面一行是主窗体InitializeComponent()方法中需要添加的引用private void Form1_SizeChanged(object sender, EventArgs e)
    {
    if (this.WindowState==FormWindowState.Minimized)
    {
    this.Hide();
    this.notifyIcon1.Visible=true;
    }}
    4.添加点击图标事件(首先需要添加事件引用):private void notifyIcon1_Click(object sender, EventArgs e)
    {
    this.Visible = true;this.WindowState = FormWindowState.Normal;this.notifyIcon1.Visible = false;
    }5.可以给notifyIcon添加右键菜单:主窗体中拖入一个ContextMenu控件contextMenu1,点中控件,在上下文菜单中添加菜单,notifyIcon1的ContextMenu行为中选中contextMenu1作为上下文菜单。(可以在子菜单中添加行为)
      

  7.   

    vb.net里面是me
    C# 里面是 this
      

  8.   

    http://www.google.com/custom?domains=www.aspxboy.com&q=托盘&sa=%CB%D1%CB%F7&sitesearch=www.aspxboy.com&client=pub-0893236326612531&forid=1&ie=GB2312&oe=GB2312&cof=GALT%3A%230066CC%3BGL%3A1%3BDIV%3A%23999999%3BVLC%3A336633%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3AFF9900%3BALC%3A0066CC%3BLC%3A0066CC%3BT%3A000000%3BGFNT%3A666666%3BGIMP%3A666666%3BFORID%3A1%3B&hl=zh-CN
      

  9.   

    最小化到托盘 caizhenfang(边缘人) 已经给了如果要实现关闭的时候最小化挂Form的Closing事件private void Form_Closing(object sender, CancelEventArgs e)
    {
    e.Cancel = true; //取消关闭
    this.WindowState = FormWindowState.Minimized;//设置为最小化
    }
      

  10.   

    caizhenfang(边缘人)  的方法甚好! 帮楼主顶一顶!
      

  11.   

    private void Form1_SizeChanged(object sender, System.EventArgs e)
    {
    if(this.WindowState == FormWindowState.Minimized)
    {
    this.Visible = false;
    this.notifyIcon1.Visible = true;
    }
    } private void notifyIcon1_Click(object sender, System.EventArgs e)
    {

    this.Visible = true;
    this.WindowState = FormWindowState.Normal;
    this.notifyIcon1.Visible = false;

    }
      

  12.   

    http://www.aspxboy.com/private/showthread.asp?threadid=376
      

  13.   

    protected  override  void  OnClosing(CancelEventArgs  e)   //重载关闭事件,使得按X是最小化
    {   
    HideTaskIco();
    e.Cancel=true;
    }
      

  14.   

    http://blog.csdn.net/chengking/archive/2005/11/06/524162.aspx
    中第四个软件实现了. 可以下载看一下.
      

  15.   

    NotifyIcon组件,然后加个菜单,关联。
      

  16.   

    this.Hide();为 NotifyIcon 控件配置一个 ContextMenu,至少给出一个菜单项,用于点击事件操作,此事件中写上:
    this.WindowState = WindowState.Normal
      

  17.   

    添加noifyicon控件。点击窗体的最小化时,窗体.visible = false 。notifyicon.visible = true;
    点击notifyicon 时,窗体.visible = true,notifyicon = false