15,908,115 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10686581 (Top 14 by date)
Member 10686581
28-Nov-14 11:04am
View
Still the same problem
Member 10686581
21-Mar-14 12:27pm
View
Yeah I've done that now here is the code I have used:
private void btnCheck_Click(object sender, EventArgs e)
{
String AllowedChars = ("^(?!PAN)(?!SOS)[A-Z]{3}\\d{4}$");
if (Regex.IsMatch(txtIdentification.Text, AllowedChars))
{
MessageBox.Show("Valid");
}
else
{
MessageBox.Show("Invalid");
}
}
When I enter a PAN or SOS I need it to give me a different output, how do I do this?
Member 10686581
21-Mar-14 12:13pm
View
Thank you this looks like what I'm looking for but I need the code for windows form.
I have a textbox and a button, once the button is clicked it needs to check what the user has inputted in the textbox, how would I go about adapting your code in this way? I would need to display the valid and invalid outputs in either another textbox or as an error message.
Member 10686581
21-Mar-14 12:04pm
View
It's not me whos idea it is to let the user input an incorrect format lol, it just needs to be able to display a message saying invalid format.. I tried to create a regular expression for the format of LLLNNNN using a program but it just gives me: [a-zA-Z]{3}[0-9]{4}
Once I get the expression could I just use it like this:
private void textBox5_Validating(object sender, CancelEventArgs e)
{
String AllowedChars = [a-zA-Z]{3}[0-9]{4};
if (Regex.IsMatch(textBox5.Text, AllowedChars))
{
MessageBox.Show("Valid");
}
else
{
MessageBox.Show("Invalid");
}
}
Member 10686581
21-Mar-14 11:37am
View
I don't think masking will work because when the user inputs the ID, I need to display whether it is valid or invalid in another text box.. if I used masking it would let the user only enter in a valid format so it leaves no room to enter an invalid one.
Just looked at the regular expressions, it's so confusing!
Member 10686581
21-Mar-14 11:28am
View
I don't think masking will work because when the user inputs the ID, I need to display whether it is valid or invalid in another text box.. if I used masking it would let the user only enter in a valid format so it leaves no room to enter an invalid one.
Member 10686581
20-Mar-14 17:02pm
View
I want to block them from inputting anything in the countdown box as this is what displays the countdown.
Member 10686581
20-Mar-14 16:53pm
View
Your code would mean they can input numbers though right? I don't want them to input numbers or text.
Member 10686581
20-Mar-14 16:38pm
View
Sorry, I worded my question badly, basically I have two text boxes one which the user inputs how many seconds to count down and the other to display the countdown, I want to stop the user from inputting any text or numbers in the countdown box.
Member 10686581
20-Mar-14 15:07pm
View
Do you know how I can stop the user from inputting text into the countdown textbox because when they do this it messes up.
Member 10686581
20-Mar-14 14:58pm
View
Still the same problem, when I change it to stop at -1 then it works fine! Weird..
Member 10686581
20-Mar-14 14:56pm
View
When I remove "duration--;" the timer does not count down.. when I have it, it will countdown but it just doesn't start instantly and the panel changes colour 1 second early.
Member 10686581
20-Mar-14 14:43pm
View
Thanks but this just does gives me the same problem as my original code.
Member 10686581
20-Mar-14 14:42pm
View
It's just a simple timer from the components area in the toolbox, with the interval set to 1000.
Show More