Wondering if anyone may be seeing the same... I am trying to pop up a listbox but now with v4 its not showing up... Now the odd thing is if i add something to just throw up a basic message box first then it shows up.
This is what im doing and its not showing up... I know its there because the install process is hanging waiting for a response but im not seeing the listbox.
This is what im using....
#Populate Site list array from Sitelist.txt
$SiteList = Get-Content -Path "$($adtSession.DirFiles)\Sitelist.txt"
#List box to choose site if app has not already been installed on the machine before.
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object System.Windows.Forms.Form
$form.Text = 'Site Picker'
$form.Size = New-Object System.Drawing.Size(350, 250)
$form.StartPosition = 'CenterScreen'
$OKButton = New-Object System.Windows.Forms.Button
$OKButton.Location = New-Object System.Drawing.Point(130, 160)
$OKButton.Size = New-Object System.Drawing.Size(75, 23)
$OKButton.Text = 'OK'
$OKButton.DialogResult = [System.Windows.Forms.DialogResult]::OK
$form.AcceptButton = $OKButton
$form.Controls.Add($OKButton)
$label = New-Object System.Windows.Forms.Label
$label.Location = New-Object System.Drawing.Point(10, 20)
$label.Size = New-Object System.Drawing.Size(320, 30)
$label.Text = 'A previous version was not detected. Please choose a site from the list.'
$form.Controls.Add($label)
$listBox = New-Object System.Windows.Forms.ListBox
$listBox.Location = New-Object System.Drawing.Point(95, 70)
$listBox.Size = New-Object System.Drawing.Size(160, 20)
$listBox.Height = 80
foreach ($item in ($Sitelist)) {
$listBox.Items.Add($item)
}
$form.Controls.Add($listBox)
$form.Topmost = $true
$result = $form.ShowDialog()
[string]$IMSINIServer = $listBox.SelectedItem
NOW... What is not making sense if i put this first....
System.Windows.MessageBox::Show('Hello')
I get the popup with hello, and then i will see the list box.
Of course i dont want a box and then the listbox, i just want the listbox....
Any help appreciated!
