TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ronok Bhowmik
NA
37
30.5k
Validate TextBox using regex where 1st input is alphabet
Feb 20 2014 2:13 PM
I have a textbox.I want to validate this textbox where i wish to enter the 1st letter as an alphabet and then numeric value(from 0 to 9). As say i want the input as F1,then how can i implement this sort of problem.Please help me to do so.I use a code but it donot works.
Here is my code:
***************************************************************
private void button1_Click(object sender, RoutedEventArgs e)
{
if (textBox1.Text.Length == 0 )
{
MessageBox.Show("Please Enter your Phone No First", "Message", MessageBoxButton.OK, MessageBoxImage.Error);
}
else if( else if (!Regex.IsMatch(textBox1.Text, @"^\[A-Z]\s[0-9]")))
{
MessageBox.Show("Data entry Successful", "Messsage", MessageBoxButton.OK, MessageBoxImage.Information);
}
else
{
MessageBox.Show("Illegal entry", "Messsage", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
Reply
Answers (
3
)
How to prevent the program from being decompiled in DotNet?
circular dependencies error