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.
Posts: 40
Last visit: Tue Mar 16, 2021 4:11 am

validate a textbox

Post by klarlichter »

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


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).

Posts: 14872
Last visit: Wed Jul 28, 2021 12:11 pm
Answers: 12
Has voted: 3 times
Been upvoted: 10 times

Re: validate a textbox

Post by jvierra »

For this you would want to use RegEx pattern matching in the "Validating" event.