#KBASIC GUI BUILDER CODE#
The following code will be executed when the user clicks on the button.
![kbasic gui builder kbasic gui builder](https://i.stack.imgur.com/C2FvE.jpg)
Now put the button on the form: $Button = New-Object The second will show the time of the last password change for the selected user account: $Label2 = New-Object
![kbasic gui builder kbasic gui builder](https://www.researchgate.net/profile/Gerro-Prinsloo/publication/274009052/figure/fig4/AS:667718005043214@1536207786711/Example-of-an-NI-cRIO-9074-integrated-CompactRIO-solar-tracker-controller-showing-the.jpg)
$ComboBox.Location = New-Object (60,10)Īdd two more labels to the form. $Users = get-aduser -filter * -Properties SamAccountName You can get AD user list using the Get-ADuser cmdlet (from Active Directory for Windows PowerShell module): $ComboBox = New-Object $Label.Location = New-Object (0,10)Ĭreate a drop-down list and fill it with a list of accounts from the Active Directory domain. To add various graphical dialog and control elements to it, add the code below before the last line ($main_form.ShowDialog()).Ĭreate a label element on the form: $Label = New-Object Adding Dialog-Box Components to your PowerShell FormĪs you can see, an empty form is displayed.