Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Visual Basic: Separating Groups Of optionbuttons

Options
  • 06-12-2005 4:57pm
    #1
    Closed Accounts Posts: 68 ✭✭


    I'm only beginning visual basic so bare with me. My class has created a form for putting people into categories based on their sex and age with radio buttons, i.e - male or female *and* minor, teenager, adult or OAP. When we start the form it does not recognise the separate groups of radio buttons so we can only select one radio button of the six at a time instead of two separate selections even though we have named each group separately, one as 'optsex' and the other as 'optage'. The first group is indexed 0 and 1 to male and female accordingly, and the second group 0 to 3. It seems only to work when we use frames but shouldn't it work without them? What are we doing wrong?

    optionbuttons.jpg


Comments

  • Registered Users Posts: 6,508 ✭✭✭daymobrew


    I went to http://msdn.microsoft.com and searched for radio button groups
    The first result: Closer Look: Using Multiple Groups of Radio Buttons

    Usability: Don't forget to add text to explain the ages each age category corresponds to. Is nineteen adult or teenager?
    For less giggles you could change 'Sex' to 'Gender'.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Or you could change the Sex options to Yes and No :v:

    It looks like your using vb6. If so try putting a frame around each group of radiobuttons.


  • Closed Accounts Posts: 68 ✭✭spitfier


    daymobrew wrote:
    Usability: Don't forget to add text to explain the ages each age category corresponds to. Is nineteen adult or teenager?

    Good point. A minor could also be a teenager. This is the form as we were given it to create so I'll raise this issue with our instuctor. He spent time during the induction of our first class in September explaining to us when designing a program you must take everything that could be entered into it in error into account and assume nothing, clarifying anything cloudy with the client. Perhaps this was a test.
    daymobrew wrote:
    For less giggles you could change 'Sex' to 'Gender'.

    I'm on it!


  • Closed Accounts Posts: 68 ✭✭spitfier


    Evil Phil wrote:
    Or you could change the Sex options to Yes and No :v:

    As a matter of fact I'd be lying to tell you tell you that that thought hadn't crossed my mind when designing the form :D
    If so try putting a frame around each group of radiobuttons.
    spitfier wrote:
    It seems only to work when we use frames but shouldn't it work without them? What are we doing wrong?
    :rolleyes:

    I'm going to have a look at the links pasted by daymobrew and I'll post here about how we got on using them during class.


  • Registered Users Posts: 3,886 ✭✭✭cgarvey


    /me giggles as he offers some VB advice, of all things...

    Could it be because you have all the options in one control array? See in your screen grab you have optsex(0), which implies that the option selected on the form is the 1st element of a control array.

    If so, what I'd do (if starting from scratch) is to drag an option button on to the form, CTRL+C it, CTRL+V it and say yes when it asks me to I wan to create a control array. I'd copy/paste it again for the number of options I want in that group.

    When I want to start a new group, I'd drag an option buton from the tools box over again (i.e. not copy/paste an existing one), and then copy/paste that new one for each option in my 2nd group .. and so on.

    Also, looking into using the Frame tool for better grouping.

    HTH (and that I've understood your problem!)

    .cg


  • Advertisement
Advertisement