refresh dialog

Welcome Forums General PowerShell Q&A refresh dialog

  • This topic has 3 replies, 2 voices, and was last updated 1 month ago by
    Participant
    .
Viewing 3 reply threads
  • Author
    Posts
    • #251582
      Participant
      Topics: 26
      Replies: 41
      Points: 381
      Rank: Contributor

      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 = {<br />if ($radiobuttonUser.Checked)<br />{ $groupbox20.Enabled = $true }<br />else<br />{ $groupbox20.Enabled = $false }<br />[System.Windows.Forms.Application]::DoEvents()<br />}<br />

    • #251615
      Participant
      Topics: 15
      Replies: 1776
      Points: 3,218
      Helping Hand
      Rank: Community Hero

      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.

    • #251636
      Participant
      Topics: 26
      Replies: 41
      Points: 381
      Rank: Contributor

      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.

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

      🙁

    • #251642
      Participant
      Topics: 26
      Replies: 41
      Points: 381
      Rank: Contributor

      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.

      _mouseClick does the job when there is no typo 😉

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

Viewing 3 reply threads
  • You must be logged in to reply to this topic.