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 do I display different group boxes, according to radio button selected ?

How do I display different group boxes, according to radio button selected ?

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 2 Posters 1 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.
  • U Offline
    U Offline
    User 11413333
    wrote on last edited by
    #1

    Hi, i have 3 radiobutton, and 3 groupboxes, what im trying to do is when you chose one radiobutton, it will display a groupbox. what i have(doesnt work), for each radiobutton is : if radiobutton.checked then groupbox1.visible = true groupbox2.visible = False groupbox3.visible = False else end if

    W 1 Reply Last reply
    0
    • U User 11413333

      Hi, i have 3 radiobutton, and 3 groupboxes, what im trying to do is when you chose one radiobutton, it will display a groupbox. what i have(doesnt work), for each radiobutton is : if radiobutton.checked then groupbox1.visible = true groupbox2.visible = False groupbox3.visible = False else end if

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      I have to say that the user interface sound a bit odd if controls are shown or hidden based on radio buttons. Anyhow, can you simply use (without any if)

      groupbox1.Visible = radiobutton1.Checked
      groupbox2.Visible = radiobutton2.Checked
      groupbox3.Visible = radiobutton3.Checked

      U 1 Reply Last reply
      0
      • W Wendelius

        I have to say that the user interface sound a bit odd if controls are shown or hidden based on radio buttons. Anyhow, can you simply use (without any if)

        groupbox1.Visible = radiobutton1.Checked
        groupbox2.Visible = radiobutton2.Checked
        groupbox3.Visible = radiobutton3.Checked

        U Offline
        U Offline
        User 11413333
        wrote on last edited by
        #3

        right, but which sub a insert that in ?

        W 1 Reply Last reply
        0
        • U User 11413333

          right, but which sub a insert that in ?

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Use the CheckedChanged[^] event for the radio buttons. Since the code is the same for all radio buttons you can wire all the three events into the same event handler.

          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