PC Review


Reply
Thread Tools Rate Thread

Textbox validation

 
 
Stefan Richter
Guest
Posts: n/a
 
      6th May 2004
I need to check if all digits entered in several textboxes are numbers
smaller then 100.000

When there is at least on error, I want to display an error message. When
all errors are fixed, the message should disappear again. An errorcounter
doesn't work, because 2 valid numbers would "delete 2 errors. Have I got to
use an errorvar for every field or is there a better way?





Thanks,



Stefan


 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmFzb24=?=
Guest
Posts: n/a
 
      6th May 2004
You could use the textchanged event

private void textBox1_TextChanged(object sender, System.EventArgs e)
{
if( Convert.ToInt32( this.textBox1.Text ) >= 100000 )
{
this.label1.Text = "Error Message for user here.";
this.button1.Enabled = false;
}
else
{
this.button1.Enabled = true;
this.label1.Text = "Success message here";
}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date validation in subform textbox dependent upon form textbox kmsacca Microsoft Access Forms 1 26th Aug 2009 12:16 AM
Textbox fomatting value based on another textbox job Microsoft Excel Discussion 2 2nd Feb 2005 05:14 PM
Re: How to move cursor from one textbox control to another textbox con Tom Ogilvy Microsoft Excel Programming 1 16th Sep 2004 03:42 PM
IE6 Freezes when moving from textbox to textbox Prodip Saha Windows XP Internet Explorer 2 2nd Sep 2003 02:29 AM
Re: UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E Microsoft Excel Programming 1 28th Jul 2003 07:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 AM.