| | |
How to Validate the Text in a TextBox
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
Use the Validated or Validating events of your textbox.
Something like:
private void Mytextbox_Validating(object sender,CancelEventAgrs e)
{
//check for int
//if not int:
// e.Cancel = true;
// MessageBox.Show("You need to enter an integer");
}
Something like:
private void Mytextbox_Validating(object sender,CancelEventAgrs e)
{
//check for int
//if not int:
// e.Cancel = true;
// MessageBox.Show("You need to enter an integer");
}
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
![]() |
Similar Threads
- text box validataion (ASP.NET)
- How to validate textbox with date type!! (VB.NET)
- How do I validate a TAB event? (Visual Basic 4 / 5 / 6)
- Validating data in a Textbox (VB.NET)
- how to get 1 submit button to validate user's choice (ASP)
- How to use Regex for Normal TextBox Control (C#)
- Validate textboxes (HTML and CSS)
Other Threads in the C# Forum
- Previous Thread: sql
- Next Thread: Degrees to Radians
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart basic bitmap box broadcast buttons c# check checkbox client combobox contorl control conversion csharp custom database datagrid datagridview dataset datetime degrees deployment development disabled displayingopenforms draganddrop drawing editing editor encryption enum event excel file form format forms function gdi+ httpwebrequest i18n image imageprocessing index input install java label list listbox mandelbrot math mathematics mouseclick mysql operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox rows server setup sleep socket sql statistics stream string table text textbox thread time timer update user usercontrol validation visualstudio webbrowser windows winforms wpf xml






