Prevent next event handler being called

后端 未结 6 1203
孤街浪徒
孤街浪徒 2021-01-21 01:35

I have two event handlers wired up to a button click in a Windows form like so:

this.BtnCreate.Click += new System.EventHandler(new RdlcCreator().FirstHandler);
         


        
6条回答
  •  醉梦人生
    2021-01-21 02:17

    Add the following condition in this.BtnCreate_Click which is the the second event

    BtnCreate_Click(object sender, EventArgs e)  
    {     
       if (!ConditionSatisfied)       //Prevent next handler in sequence being executed 
       {
         // your implementation goes here
       }   
    }  
    

提交回复
热议问题