Textbox.text

Welcome Forums General PowerShell Q&A Textbox.text

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
1 year, 11 months ago.

  • Author
    Posts
  • #59374

    Participant
    Points: 0
    Rank: Member

    Hi, what is the easiest way to check if the text in a textbox ($textbox1) contains a word like _DOM1 and have it stop there if it contains _DOM1? I use something similar to check if the textbox is empty: Thanks for any help in advance.

    if ($textbox1.textLength -eq 0) { $statusbar1.text = " ACTIVE GROUP BOX IS EMPTY " }
    	else
    	{ 
    
    
    
  • #59416

    Participant
    Points: 160
    Helping Hand
    Rank: Participant

    When you are using a .NET GUI, your first line of defense should be form validation. Here is one implementation on StackOverflow:

    http://stackoverflow.com/questions/32744858/powershell-forms-how-to-validate-different-types-of-system-windows-forms-togeth

    That post is doing validation on specific events being triggered, like the text changing. You can also do it on submit to validated everything is correct before calling other functions in your code.

The topic ‘Textbox.text’ is closed to new replies.