As a start to get used to PS Studio 2015, I am working with creating simple form. First thing I have tried I am stuck on. I want to create a readonly text box and have it populate when the GUI opens. In my example I just want the current domain using Get-ADDomain | %{$_.DNSRoot}.
I can do this with a lable in my "manual typing"s script
PowerShell Code
Double-click the code block to select all.$LabelDomain1 = New-Object System.Windows.Forms.Label $LabelDomain1.Location = New-Object System.Drawing.Point(45, 205) $LabelDomain1.Size = New-Object System.Drawing.Size(400, 310) $CurrentDomain = Get-ADDomain | %{$_.Name} $LabelDomain1.Text = $CurrentDomain $Form1.Controls.Add($LabelDomain1)When I look at my forms script I see $TextBoxCurrentDomain_TextChanged, I thought by adding
$TextBoxCurrentDomain_TextChanged.Text = $CurrentDomain, but no luck.
Also, is there a link with example GUI's I can look at? The link I was sent by Support was for very basic GUI's and not much help