VB.NET default radio button selected inside a group box

前端 未结 8 785
醉话见心
醉话见心 2021-01-16 05:46

I have a WinForms application (VS 2008, .NET 3.5) that has a form with two different group boxes, and inside of each group box are different sets of radio buttons. When I r

相关标签:
8条回答
  • 2021-01-16 06:16

    RadioButton1.checked = False under Form_Activated works.

    0 讨论(0)
  • 2021-01-16 06:17

    Set Auto Check to "False" on all the radio buttons, both groups. Set them all back to "True". This worked for me. I also had to group boxes the one was good the second one came with the first button checked (selected).

    0 讨论(0)
  • 2021-01-16 06:26

    Just change the groupbox accessible role property from default to none It will work ☺️

    0 讨论(0)
  • 2021-01-16 06:29

    Set all the buttons' AutoCheck property to False. You'll now have to write a Click handler for them to set their Checked property. A sample handler that takes care of two of them:

      Private Sub RadioButton_Click(ByVal sender As Object, ByVal e As EventArgs) _
          Handles RadioButton1.Click, RadioButton2.Click
        Dim button As RadioButton = DirectCast(sender, RadioButton)
        RadioButton1.Checked = button is RadioButton1
        RadioButton2.Checked = button Is RadioButton2
      End Sub
    
    0 讨论(0)
  • 2021-01-16 06:30

    i had this problem, and making Autocheck=false, did the trick. and YES the RadioButton1 was TAB=0

    ThankYou

    0 讨论(0)
  • 2021-01-16 06:34

    If your lowest Tab Index is a Radio Button, and you have AutoCheck set to True, then when the form loads and sets the active element to the lowest Tab Index, it acts as if you had clicked on the Radio Button, tripping the AutoCheck and therefore checking the Radio Button. Simply give another control on the form the Tab Index of 0.

    0 讨论(0)
提交回复
热议问题