Subscribe to Articles
How to Create Numeric Textbox Control for windows application.
Let's create User Control.Start Visual Studio 2005.File -New-Project Type Visual C#Select Windows Control Library from the Templates.Specify Name with NumericTextBox and save on proper location.Visual Studio Opens with Blank Control.Right Click on Blank Control and View CodeInherit TextBox control by modifying System.Windows.Forms.TextBox on UserControl.Add code in control to restrict for non-numeric input by user. Open UserControl1.Designer.cs from Solution Explorer and pass comment to the line, shown in below:Now, Build - Build NumericTextBox.Build Succeeded. How to use User defined control NumericTextBox in windows ApplicationCreate Windows Application with name PhoneDictionary. Select ToolBox and Right Click on All Windows Forms then click on Choose items... .NET Framework Components by default shown after Choose Items...Now, browse to location where NumericTextBox.dll saved, select NumericTextBox.dll click open button and to close Choose Toolbox Items. Add User Control to form.Click on Start Debugging or press F5.There are only numeric input has been accepted in the shown textbox(NumericTextBox). User Control will be used in many more times in application/project in Visual Studio. Thanks.