Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to group Radio button without using GroupBox ?

How to group Radio button without using GroupBox ?

Scheduled Pinned Locked Moved Visual Basic
tutorialhelpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cheeken2u
    wrote on last edited by
    #1

    i have 4 radio button, for example, radiobutton 1 is A1 radiobutton 2 is A2 radiobutton 3 is B1 radiobutton 4 is B2 While i run the application, by default, it only allow me to checked either one of four radiobutton. i want my application group it into two group, A1 and A2 in one group and B1 and B2 in another group. So, while i Click A1, A2 will be unchecked and while i click A2, A1 will be unchecked as well, and B1 and B2 is remain the same. So , this criteria also same as B1 and B2, while i click either B1 and B2, it is no effect A1 and A2, how to gorup it ar? without put it into group box, anybody can help me ?

    Best regards, Chee ken

    C J J 3 Replies Last reply
    0
    • C cheeken2u

      i have 4 radio button, for example, radiobutton 1 is A1 radiobutton 2 is A2 radiobutton 3 is B1 radiobutton 4 is B2 While i run the application, by default, it only allow me to checked either one of four radiobutton. i want my application group it into two group, A1 and A2 in one group and B1 and B2 in another group. So, while i Click A1, A2 will be unchecked and while i click A2, A1 will be unchecked as well, and B1 and B2 is remain the same. So , this criteria also same as B1 and B2, while i click either B1 and B2, it is no effect A1 and A2, how to gorup it ar? without put it into group box, anybody can help me ?

      Best regards, Chee ken

      C Offline
      C Offline
      ChandraRam
      wrote on last edited by
      #2

      cheeken2u wrote:

      without put it into group box

      Why not?? :confused:

      1 Reply Last reply
      0
      • C cheeken2u

        i have 4 radio button, for example, radiobutton 1 is A1 radiobutton 2 is A2 radiobutton 3 is B1 radiobutton 4 is B2 While i run the application, by default, it only allow me to checked either one of four radiobutton. i want my application group it into two group, A1 and A2 in one group and B1 and B2 in another group. So, while i Click A1, A2 will be unchecked and while i click A2, A1 will be unchecked as well, and B1 and B2 is remain the same. So , this criteria also same as B1 and B2, while i click either B1 and B2, it is no effect A1 and A2, how to gorup it ar? without put it into group box, anybody can help me ?

        Best regards, Chee ken

        J Offline
        J Offline
        JUNEYT
        wrote on last edited by
        #3

        You suppose to use group box to group radio buttons. If you don't want to that you can still imitate the radiobuttons as grouped in your code. Please see the example below. I have controled two radio buttons out of a group box. If one's state changes, I change the other radio button's states also. :wtf: Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged Select Case RadioButton1.Checked Case True RadioButton2.Checked = False Case False RadioButton2.Checked = True End Select End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged Select Case RadioButton2.Checked Case True RadioButton1.Checked = False Case False RadioButton1.Checked = True End Select End Sub

        What a curious mind needs to discover knowledge is noting else than a pin-hole.

        1 Reply Last reply
        0
        • C cheeken2u

          i have 4 radio button, for example, radiobutton 1 is A1 radiobutton 2 is A2 radiobutton 3 is B1 radiobutton 4 is B2 While i run the application, by default, it only allow me to checked either one of four radiobutton. i want my application group it into two group, A1 and A2 in one group and B1 and B2 in another group. So, while i Click A1, A2 will be unchecked and while i click A2, A1 will be unchecked as well, and B1 and B2 is remain the same. So , this criteria also same as B1 and B2, while i click either B1 and B2, it is no effect A1 and A2, how to gorup it ar? without put it into group box, anybody can help me ?

          Best regards, Chee ken

          J Offline
          J Offline
          Johan Hakkesteegt
          wrote on last edited by
          #4

          Hi Chee Ken, If you don't want to use GroupBox controls to group your radio buttons, because you don't want the border and title of that control, you can use Panel controls, which are practically the same, but have no visible borders and no title text. Otherwise they work pretty much the same way. Good luck, Johan

          My advice is free, and you may get what you paid for.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups