New to this, trying to learn
Posted: Wed Oct 10, 2018 7:44 am
Hi! I hope my question is ok for the forums. I'm quite new to dealing with windows forms, so here we go:
I made a simple "Empty Form" using the template.
From there I used the toolbox and added one button, one textbox (to be used for input), and another textbox (for displaying results from my command).
So the code I got so far is:
So my $searchbutton is supposed to take the .text from $usersearchbox and use it with get-localuser.
That seems to work, because I get errors if I type in a user that dosent exist and press my button.
But I can't seem to get the results into my $textbox1.
I would appreciate if anyone could show me how to get this right. And maybe link to some documentation I can read relating to how new I am to this.
I made a simple "Empty Form" using the template.
From there I used the toolbox and added one button, one textbox (to be used for input), and another textbox (for displaying results from my command).
So the code I got so far is:
Code: Select all
$formLocalUserLookup_Load={
}
$searchbutton_Click={
$global:user = Get-LocalUser $inputuser
}
$usersearchbox_TextChanged={
$global:inputuser = $usersearchbox.Text
}
$textbox1_TextChanged={
#This is where I can't get it to work
$textbox1.Text = $user
}
That seems to work, because I get errors if I type in a user that dosent exist and press my button.
But I can't seem to get the results into my $textbox1.
I would appreciate if anyone could show me how to get this right. And maybe link to some documentation I can read relating to how new I am to this.