65.9K
CodeProject is changing. Read more.
Home

My TextBox with Validate Option

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.48/5 (6 votes)

Nov 8, 2006

viewsIcon

21460

downloadIcon

453

Special Text Box control with functionality of validating and controlling handled text data

Sample Image - M3MTextBox.jpg

Introduction

The M3M M3MTextBox control specially designed as one most required control in windows application development where we take more times in validating entered data into normal .net textbox with if statements, with different techniques like coloring error, side icon or message box. Also this control uses regular expressions as validation test.

Sample Code

In the next code snap snap shows how we can use this control throug our code

 
M3MTextBox1 = New M3M_TextBox.M3MTextBox
' this message text used when msg mode set to MsgBox mode
M3MTextBox1.ErrMessage = ""
M3MTextBox1.ErrorMessage = M3M_TextBox.ErrMsgType.Icon
M3MTextBox1.InformBackColor = System.Drawing.Color.LightGray
M3MTextBox1.InformForeColor = System.Drawing.Color.Wheat
M3MTextBox1.Location = New System.Drawing.Point(148, 64)
M3MTextBox1.Name = "M3MTextBox1"
M3MTextBox1.ReadyRegEx = M3M_TextBox.AvilableRegularExpression.Custom
M3MTextBox1.RequiredBackColor = System.Drawing.Color.Red
M3MTextBox1.RequiredForeColor = System.Drawing.Color.Yellow
M3MTextBox1.Size = New System.Drawing.Size(126, 20)
M3MTextBox1.TabIndex = 0

 

also control trigger special event when error accrue Called  ErrorRasied in case if we want take special megerments when error happen in user entered data.