I have a simple form. 1 button and 1 Listbox. The code on my button is this:
$button1_Click={
$Query = "SELECT * FROM CIM_VideoControllerResolution"
$res = Get-WMIObject -query $Query | Select Caption # | Out-GridView -Title "Resolution options"
}
I commented out the Gridview but if I remove this comment I do get all of my data as expected. I then try to load this list box and I've tried both of these methods.
Load-ListBox $listbox1 $res -Append
Load-ListBox $Listbox1 $res 'Resolution'
Neither one will enter date into the ListBox. How come?
Listbox Question
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Listbox Question
I got it. I was placing my Load-Listbox in the wrong place. when I place it within the BUTTON code it works.