Radio Button question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blazted
    New Member
    • Mar 2007
    • 17

    Radio Button question

    This is a really bad question but I am not familiar with VB. I have three radio buttons in a group box. I want to have it that by default none are checked. I set the checked property on all three to false yet the first one is always checked even if I set it to false. i even tried removing the group box but always one of the boxes is checked. How can I default it to no boxes checked?
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Originally posted by blazted
    This is a really bad question but I am not familiar with VB. I have three radio buttons in a group box. I want to have it that by default none are checked. I set the checked property on all three to false yet the first one is always checked even if I set it to false. i even tried removing the group box but always one of the boxes is checked. How can I default it to no boxes checked?
    what version of VB are you using?

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      The technical details will be heavily dependant on the VB version, which is why kadghar asked above. But you might find it's not possible (or difficult to achieve). The whole purpose of radio buttons is to let you "toggle" or "switch" between mutually exclusive options. If one of the options is "no option" then you probably should have a radio button for that.

      In the meantime, you might try seeing whether you can be a bit sneaky. For instance, try hiding your default option behind another control, moving it off the edge of the form where it can't be seen, setting them all to unselected in your startup code, or simply setting its visibility to False. I have no idea whether any of these will work - I'm just throwing out whatever ideas come to mind.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        set the tabindex property of any other control other than option buttons to 0

        Comment

        • shuvo2k6
          New Member
          • Jan 2008
          • 68

          #5
          Originally posted by blazted
          This is a really bad question but I am not familiar with VB. I have three radio buttons in a group box. I want to have it that by default none are checked. I set the checked property on all three to false yet the first one is always checked even if I set it to false. i even tried removing the group box but always one of the boxes is checked. How can I default it to no boxes checked?

          Hi,
          You can do this by the following way:
          At first you add 'TextBox' to your 'Form' & set its 'Tab Index' property to Zero(0). Then you add 'RadioButton' & 'GroupBox'. You can try by this.

          If you get success, reply me.
          Get Better.

          Regards,
          shuvo2k6
          Last edited by Killer42; Jan 31 '08, 05:16 AM. Reason: Corrected some "textisms" - "u", "ur" etc.

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by debasisdas
            set the tabindex property of any other control other than option buttons to 0
            In VB6, setting the TabIndex to 0 just places the control first in the tab sequence, everything else simply moves down one place. The only effect that has is the order in which they receive focus as the user hits the Tab key. Is that what you intended? Or is it different in later versions?

            Comment

            Working...