title: Detection of Backspace on KeyDown
body: <p>I am working on a silverlight web app. It interacts with a module that sends SMS's. I want to limit the text to 160 and show a counter. I did it like this:</p>
  
  <pre><code>public partial class SendSMSView
  {
      public SendSMSView()
      {
         InitializeComponent();
         ApplyTheme();
      }
  
      protected void tbMessage_KeyDown(object sender, KeyEventArgs e)
      {
          count = 160 - this.tbMessage.Text.Length;
          this.lblCount.Content = count.ToString();
      }
  }
  </code></pre>
  
  <p>This works fine for all the keys except backspace and delete. Of course it is made to function like this. i dug more on this and tried overriding keydown event so i added the following code snippet:</p>
  
  <pre><code>public class CustomTextBox : TextBox
  {
      public CustomTextBox(): base()
      {
      }
  
      protected override void OnKeyDown(KeyEventArgs e)
      {
          e.handler=false;
          base.OnKeyDown(e);
          //this place
      }
  }
  </code></pre>
  
  <p>In OnKeyDown function i get all the key strokes registered. Setting Handler to false here doesnt help and still i cant get backspace to trigger  tbMessage_KeyDow.</p>
  
  <p>I want to somehow call the  tbMessage_KeyDow function from //this place forcefully from there for backspace. </p>
  
  <p>I searched MSDN, and found that IsInputKey can be overriden to return true so that onKeyDown responds to it as well, but My framework neither has IsInputKey nor PreviewKeyPress. Is there a workaround for getting backspace key registered as input key, or to call  tbMessage_KeyDow [which is very crude approach] ? Please help.</p>