I am currently working on a Windows form application. How can i create the Validation for my password textbox in visual studio (C#) that only allow the text which includes:
- At least one uppercase
- At least one lowercase
- At least one symbol
- Must be above 8 characters
Since its a Windows form application you can do the validation in code as:
You can have this code against Submit button (Button_Click event), or TextBox TextChanging. You can extract it to a method like:
For example if you want to validate the text on Button_Click then:
EDIT:
if you want a digit in the password then you can add one extra check like:
To Check for
"!@#"Add a check .