title: Preventing a TextBox leave event when loosing focus
body: <blockquote>
    <p><strong>How to stop textbox leave event on clicking on linklable/button while Textbox was in focus?</strong></p>
  </blockquote>
  
  <p>I have a textbox <code>TextBox1</code>. On leave event of it, I have to validate it's text. And as per text of it, I have to populate suggestion of next textbox <code>TextBox2</code>.</p>
  
  <p>so in this process, when I'm clicking on a link-label [which is there for different reason] while <code>TextBox1</code> is in focus, It is firing Leave event [which is obvious] and calling validating functionality [which is not supposed to be called - because user have not left textbox after completing input- It was triggered by linkable click]. </p>
  
  <p>I have tried to unsubscribe Leave event on link-label's click event but that doesn't help as leave event is being fired in first place.</p>
  
  <p>what should be done in this case ?</p>
  
  <p>EDIT :
  posting related code,</p>
  
  <p>I'm Having same Event Handler for both textbox</p>
  
  <pre><code>    private void txtBox_Leave(object sender, EventArgs e)
      {
          TextBox textBox = sender as TextBox;
          textBox.Visible = false;
  
              #region TextBox 1
              if (textBox.Equals(txtBox1))
              {
                  //Text Box 1 validation
                  //Populating Suggestions for TextBox2
                  //Passing focus on Textbox 2
              }
              #endregion
              #region TextBox 2
              else if (textBox.Equals(txtBox2))
              {
                  //Text Box 2 validation
              } 
              #endregion
       }
  </code></pre>
  
  <p>As I've mentioned earlier, Link label is there for different and I cannot disable or hide it during operation on Text box.</p>
  
  <p>One observation is,
  When I click on Link label, <strong>Leave event of text box raise first and after that Click Event of Link Label</strong>, so we cannot perform any logic (like unsubscribing leave event of Textbox or something else) on Link-Label's click event - as by the time validation process would be done which we don't want.</p>