Results 1 to 7 of 7

Thread: select case and radio buttons [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    select case and radio buttons [RESOLVED]

    If you have radio buttons and want to determine which is selected using a select case, what do you check for? I tried .checked, true and neither works.
    Last edited by Andy; Mar 25th, 2004 at 09:35 PM.

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    You sure about that? I just tried the Checked property and it seems to work fine.
    VB Code:
    1. If RadioButton1.Checked Then
    2.             MessageBox.Show("RadioButton1 is checked")
    3.         End If

  3. #3
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,963
    Hi,

    You have to be a little more restrictive when you use Select Case.

    try

    VB Code:
    1. Select Case True
    2.  
    3. case btn1.checked
    4.  code
    5. case btn2.checked
    6.   code
    7. etc
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    now, I tried that same code before I posted and it didn't work!! lol I tried it again and it works now!!! wierd

    Thanks. Maybe I had some syntax wrong somewhere.




  5. #5
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,963
    Hi,

    From your first post I thought you had tried


    VB Code:
    1. Select Case .checked = true
    2. case btn1
    3.  code
    4. case btn2
    5.   code
    6. etc

    which will not work.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    well, I tried

    VB Code:
    1. select case true
    2. yadda yadda
    3. end select

    and I tried

    VB Code:
    1. select case .checked

    they didn't work the first round. lol

    they work now. I must have typed in something wrong and didn't catch it.

  7. #7
    New Member
    Join Date
    Jan 2022
    Posts
    1

    Re: select case and radio buttons [RESOLVED]

    A newbie here, I needed this same thing and your solution worked great for me. Thanks

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