title: how to create a custom control for a textbox
body: <p>Hai Freinds  </p>
  
  <p>So far i have used this coding to create a custom Control as my knowledge in the pervious post.i dono it is correct or not.I need a further help regarding this.so far i have used this coding the appcode->Number.cs in that i have used this coding further what should i do: my requriements is that i drag the textbox in the controls only number should be entered in that. for reference see my previous post:<a href="http://www.eggheadcafe.com/community/aspnet/2/10200401/how-to-create-a-dll-file-for-the-textbox-with-some-requriments.aspx.i" rel="nofollow noreferrer">http://www.eggheadcafe.com/community/aspnet/2/10200401/how-to-create-a-dll-file-for-the-textbox-with-some-requriments.aspx.i</a> need it in web applications</p>
  
  <pre><code>using System;  
  using System.Data;  
  using System.Configuration;
  using System.Linq;
  using System.Web;
  using System.Web.Security;    
  using System.Web.UI;    
  using System.Web.UI.HtmlControls;    
  using System.Web.UI.WebControls;    
  using System.Web.UI.WebControls.WebParts;    
  using System.Xml.Linq;
  
  /// &lt;summary&gt;     
  /// Summary description for Number    
  /// &lt;/summary&gt; 
  public class Number : TextBox    
  {    
      protected override void OnKeyPress(KeyPressEventArgs e)     
      {    
          base.OnKeyPress(e);     
          if (e.KeyChar &gt;= '0' &amp;&amp; e.KeyChar &lt;= '9')     
          {    
              e.Handled = false;        
          }   
          else 
          {    
              e.Handled = true;     
          }  
      }   
  }
  </code></pre>