Custom TextBox control in .NET

This resource contains the Custom TextBox Controls which can be easily integrated with your application. This will definitely help when there are situations of restricting characters and using only numbers, currency values or percentage.There is no need of validations as the control will not allow you to type the characters. Find Custom TextBox control in .NET

Learn something about Custom TextBox control in .NET

Many of us have faced difficulty in defining the validation for restricting the characters in a textbox and allow only numbers. Here I have created a dll to solve your problems.

I have used javascripts to restrict the character typing and prefixing with the currency value for currency textbox. Most of us would have felt diffculty in restricting the characters in textbox and allow only numbers.

Also when using currency you would have provided your custom coding to control.
I have created custom textboxes to solve the problems and easily integrate the custom textbox in your application.
The dll i have created contains the following textboxes
  1. Numeric Textbox
  2. Currency Textbox
  3. Percentage Textbox
All three textboxes allows only numbers. For currency textbox the currency value will be prefixed with currency symbol based on the Culture set in globalisation.For percentage textbox the value will be displayed as %.
How to install the controls in Visual Studio?
  1. Download the attachment CustomTextBoxes.dll
  2. Include the dll in your application as reference
  3. Now in toolbox create a new tab called CustomTextBoxes
  4. Right click the tab and click choose items
  5. Now a pop will open and ask you to choose the items
  6. In that click browse button and choose the dll you downloaded
  7. now in filter type CustomTextBoxes
  8. Click ok to include the controls in your VisualStudio
How to use the controls in your application?
  1. Right click on your application and choose add reference
  2. Include the dll in your application as reference
  3. Now you can drag the CustomTextBox and use in your application
  4. CustomTextBox properties
    • In your CustomTextboxes you have following properties for each
    • MinimumAmount- Minimum value to be allowed
    • MaximumAmount-Maximum value to be allowed
    • Amount- textbox valueNote:Donot leave the amount empty. It will throw error. You must specify a value if you use Amount property.
    • NegativeColor- Color when the value is negative
    • PositiveColor- Color when the value is positive
    • Precision-The number of decimal places that the formatted amount will display.
    • Alignment: Sets the alignment of text in the control
    • OnBlur, OnFocus and OnKeyPress: The control outputs JavaScript code for these HTML events, and these properties allow additional scripts to be assigned.
  5. In the ASP.NET Web Application project Web.Config file, modify the globalization section to set a specific culture (e.g., culture="en-IN" (for english-India) etc.). Note that you must use a specific culture, not a neutral culture.

Hope this helps!!!

Steadfast technology



No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: