refresh dialog

hi all,

I have a GUI with a few radiobutton that, when I click one, I would like to enable or disable another control.

To see it work, I need to click the radiobutton twice. The first click does not change the control.

I tried a DoEvents() but it won’t work as I need it to.

Can someone please tell me what I’m missing?

thanks!

$radiobuttonUser_CheckedChanged = {
if ($radiobuttonUser.Checked)
{ $groupbox20.Enabled = $true }
else
{ $groupbox20.Enabled = $false }
[System.Windows.Forms.Application]::DoEvents()
}

Based on the documentation for CheckedChanged is for the CheckBox control and based on your variable you are using a radio button. Typically, you would use the OnClick (e.g. $radioButtonUser_Click) event.

[quote quote=251615]Based on the documentation for CheckedChanged is for the CheckBox control and based on your variable you are using a radio button. Typically, you would use the OnClick (e.g. $radioButtonUser_OnClick) event.

[/quote]

in PowerShell Studio, I see CheckedChanged, Click, MouseClick, but no onClick event. I tried all options without success.

:frowning:

[quote quote=251615]Based on the documentation for CheckedChanged is for the CheckBox control and based on your variable you are using a radio button. Typically, you would use the OnClick (e.g. $radioButtonUser_Click) event.

[/quote]

_mouseClick does the job when there is no typo :wink:

it’s all good now. thanks for pointing me in the right direction.