$TextBox.LostFocus validation, not really sure how to do this in PowerShell

Hey Guys, been a follower of this forum for a while, and powershell is not usually my go to tool, not for Gui’s at least. I usually do ASP.net, so I do my validation in the Model, and the view if needed, but that’s irrelevant to what my question is.

I’d like to validate a textbox on the LostFocus() event, but in reading online, it’s been difficult to find good examples of this because of C# and other .net examples seem to appear more relevant according to google.

I’m looking for something that will look like this – this isn’t intended to be powershell, just PseudoCode so I can convey my idea

$TextBox1.LostFocus() { if ($TextBox1.Text = "") { #DoSomething Here } } 

By looking at the .net library I see that there are events, and methods built in, so I know I can call those via PS, but I’m coming up empty on options for as to how.

Also, if you have any good resources for these more advanced concepts, I would LOVE to see those. PowerShell is pretty underrated in what it can do.

submitted by /u/ultimattt
[link] [comments]

Leave a Reply