>>shuker(秋风儿)、 cafecai(入门新手㊣) 
在其他的类中是不能用Form这个类的啊,它还未创建!编译通不过!
>>CMIC(大象)
这样是可以,但是这样做后,怎样把它调出来呢?

解决方案 »

  1.   

    在main中
    如果需要显示的时候application.run(form())
      

  2.   

    Form2 ob = new Form2();private void button1_Click(object sender, System.EventArgs e) {
    MessageBox.Show("显示");
    ob.Show();
    MessageBox.Show("隐藏");
    ob.Hide();
    MessageBox.Show("显示");
    ob.Show();
    }
      

  3.   

    补充本窗体隐藏+NotifyIcon,本例为最小化时隐藏到通知盒private void Form1_Resize(object sender, System.EventArgs e) {
    if (this.WindowState == FormWindowState.Minimized){
    //隐藏窗体
    this.Visible = false;

    this.notifyIcon1.Icon = this.Icon;
    //显示通知盒图标
    this.notifyIcon1.Visible = true;
    }
    }private void notifyIcon1_Click(object sender, System.EventArgs e) {
    //显示窗体
    this.Visible = true;
    this.WindowState = FormWindowState.Normal;

    //隐藏通知盒图标
    this.notifyIcon1.Visible = false;
    }