Click here to Skip to main content
15,908,015 members
Articles / Programming Languages / Visual Basic
Article

My TextBox with Validate Option

Rate me:
Please Sign up or sign in to vote.
1.48/5 (6 votes)
7 Nov 2006 21.3K   453   17   1
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

 <FONT size=2>
M3MTextBox1 = </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> M3M_TextBox.M3MTextBox</FONT>
' this message text used when msg mode set to MsgBox mode
<FONT size=2>M3MTextBox1.ErrMessage = </FONT><FONT color=#800000 size=2>""
</FONT><FONT size=2>M3MTextBox1.ErrorMessage = M3M_TextBox.ErrMsgType.Icon
</FONT><FONT size=2>M3MTextBox1.InformBackColor = System.Drawing.Color.LightGray
</FONT><FONT size=2>M3MTextBox1.InformForeColor = System.Drawing.Color.Wheat
</FONT><FONT size=2>M3MTextBox1.Location = </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> System.Drawing.Point(148, 64)
</FONT><FONT size=2>M3MTextBox1.Name = </FONT><FONT color=#800000 size=2>"M3MTextBox1"
</FONT><FONT size=2>M3MTextBox1.ReadyRegEx = M3M_TextBox.AvilableRegularExpression.Custom
</FONT><FONT size=2>M3MTextBox1.RequiredBackColor = System.Drawing.Color.Red
</FONT><FONT size=2>M3MTextBox1.RequiredForeColor = System.Drawing.Color.Yellow
</FONT><FONT size=2>M3MTextBox1.Size = </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> System.Drawing.Size(126, 20)
</FONT><FONT size=2>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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior) none
Palestinian Territory (Occupied) Palestinian Territory (Occupied)
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
Global Analyser3-Nov-10 9:03
Global Analyser3-Nov-10 9:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.