VB.NET radio button gets turned on (checked) without checking it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • QuickBooksDev
    New Member
    • Nov 2007
    • 6

    VB.NET radio button gets turned on (checked) without checking it

    I am new to VB.NET.

    I do not understand this behavior.

    I have a button comand followed by 3 radio buttons (ByDate, ByRef, None).
    None is marked checked at design time.

    If I click on Go the ByDate radio gets turned on (marked Checked).

    It seems that the TabIndex after Go is ByDate but why would this turn the control on???


    Thanks for your help.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to check for some default properties of the controls. Also check for any other event that you are executing in code.

    Comment

    • QuickBooksDev
      New Member
      • Nov 2007
      • 6

      #3
      Thanks but can you tell me what defaults to check?
      There is no code that turns on the radio button in the program so what events am I suppose to check.

      The workaround that I used was to change the TabIndex so that the button had a higher tabIndex than the radion buttons.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Is this a web or a windows application?

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Originally posted by QuickBooksDev
          Thanks but can you tell me what defaults to check?
          There is no code that turns on the radio button in the program so what events am I suppose to check.

          The workaround that I used was to change the TabIndex so that the button had a higher tabIndex than the radion buttons.
          If you tab to the RadioButton list, then it makes sense that it would be checked.
          Have you considered using check boxes instead?

          (Please don't forget to answer Plater's question: is this a web application or desktop application?)

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Also, if you disable your button at any point or force a lost focus, then you will implicitly be forcing the focus to another control next in line in the tab order, which would explain your tab-order quick-fix.

            Comment

            Working...