Results 1 to 7 of 7

Thread: [RESOLVED] Radio buttons not working right???

Hybrid View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Resolved [RESOLVED] Radio buttons not working right???

    I have a VB.Net 2005 application in which I have a form that contains 2 sets of Radio buttons (2 Radio Buttons per set). A screenshot of the form is attached.

    The values of these RDO's are "Yes" and "No" for each set. Each RDO is named separately. For the 1st set, I click either "Yes" or "No", however, when I click on the 2nd set...the value for the 1st set is removed. The object is that both sets contain either a "Yes" or "No" value. I set the values in the Click Event of each control. What am I doing wrong?

    Thanks,
    Blake

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Radio buttons not working right???

    you need to put each set into a different container, like a Group Box or a panel...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Fanatic Member Andy_P's Avatar
    Join Date
    May 2005
    Location
    Dunstable, England
    Posts
    669

    Re: Radio buttons not working right???

    Place each group of radio buttons in it's own container, like a GroupBox, or a panel.



    EDIT: Dammit TG, I'm just too slow.
    Using Windows XP Home sp3
    Mucking around with C# 2008 Express
    while ( this.deadHorse ) { flog( ); }


  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Radio buttons not working right???

    I'll give it a shot but why does it have to work that way? Just curious!
    Blake

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Radio buttons not working right???

    Because option buttons in the same container are considered to be a set, regardless of how many or how few there are. The only way to separate them is to use different containers. They were designed that way.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Radio buttons not working right???

    Ok,

    I did that. Now, when I select one from each container, in that RDO's Click Event, I check the .Checked Property. If it's been selected, I assign a value to a variable, but for some reason the value isn't passed back to a grid (which contains a complete record). It was passing back a value before but now that it's in a container, it's not doing it.
    Blake

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Radio buttons not working right???

    Double check the event handler.... make sure the Handles.... is still there... if not, add it back in... when you cut controls off of a form (which I assume you did to get them onto the container)... it removes the handles clause, but doesn't put it back when you paste them back.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width