Cancel form load

后端 未结 6 1345
猫巷女王i
猫巷女王i 2021-01-14 01:15

I have the following code :

This call the second form

private void updateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Up         


        
6条回答
  •  走了就别回头了
    2021-01-14 01:55

    The best way to do so :

    private void Form_Load(object sender, EventArgs e) 
    { 
       switch(funct())
       {
          case 2:
             this.BeginInvoke(new MethodInvoker(this.Close));
              break;
          case 3:
             this.BeginInvoke(new MethodInvoker(this.Close));
               break; 
         default:
               MessageBox.Show("Something");
       }   
    }
    

提交回复
热议问题