I am trying to use three radio buttons on a form. My problem resides with the use of the "waitcursor". It takes a little time for my AD to be queried and the names placed in a combobox and whil waiting, I want to change the cursor to the waitcursor. If I select the button for 'xxxxxx', the cursor changes, the comboxbox is populated, and the cursor changes back to normal. If I then select the button for yyyyyy or zzzzzz, the cursor never changes even though the combobox is populated with the correct names. Can someone please bless my ignorance and tell me what I am doing wrong or why this behavior is happening.
Thanks!!!!!
$radiobuttonxxxxxx_CheckedChanged={
#TODO: Place custom script here
$MainFormDRT.UseWaitCursor = $true
$comboboxUserName.Items.Clear()
$adusers = Get-ADUser -SearchBase 'OU=xxxxxx,DC=eatmopossum,DC=org' -Filter '*' | Select -Exp Name
Update-ComboBox -ComboBox $comboboxUserName -Items $adusers
$comboboxUserName.SelectedIndex = 0
$MainFormDRT.UseWaitCursor = $false
}
$radiobuttonyyyyyy_CheckedChanged={
#TODO: Place custom script here
$MainFormDRT.UseWaitCursor = $true
$comboboxUserName.Items.Clear()
$adusers = Get-ADUser -SearchBase 'OU=yyyyyy,DC=eatmopossum,DC=org' -Filter '*' | Select -Exp Name
Update-ComboBox -ComboBox $comboboxUserName -Items $adusers
$comboboxUserName.SelectedIndex = 0
$MainFormDRT.UseWaitCursor = $false
}
$radiobuttonzzzzzz_CheckedChanged={
#TODO: Place custom script here
$MainFormDRT.UseWaitCursor = $true
$comboboxUserName.Items.Clear()
$adusers = Get-ADUser -SearchBase 'OU=zzzzzz,DC=eatmopossum,DC=org' -Filter '*' | Select -Exp Name
Update-ComboBox -ComboBox $comboboxUserName -Items $adusers
$comboboxUserName.SelectedIndex = 0
$MainFormDRT.UseWaitCursor = $false
}
problem with radio buttons and comboboxes
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: problem with radio buttons and comboboxes
Like this:
Code: Select all
$radiobutton1_CheckedChanged={
$form1.Cursor = 'WaitCursor'
# action code
$form1.Cursor = 'Default'
}
Re: problem with radio buttons and comboboxes
thanks for the assist, it is working like I wanted it to.
Many, many THANKS!!!
Many, many THANKS!!!