validate a textbox

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
klarlichter
Posts: 40
Last visit: Sun Jan 16, 2022 3:44 am

validate a textbox

Post by klarlichter »

Hello,
I create a textbox.
It called for example $textbox1 .
How i can validate that user input a string like:

"mytest","mytest1"
or
"mytest"
or
"blabla-hgsjag.ru","mytesthsa.de"

It is important that it start with " and end with " and if many values it need be each time use , between (like my examples above).
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: validate a textbox

Post by jvierra »

For this you would want to use RegEx pattern matching in the "Validating" event.
This topic is 4 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked