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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. What is the Select Case syntax for Radio Buttons / textboxes in a GroupBox Control?

What is the Select Case syntax for Radio Buttons / textboxes in a GroupBox Control?

Scheduled Pinned Locked Moved Visual Basic
questioncsharp
2 Posts 2 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.
  • R Offline
    R Offline
    Rashar
    wrote on last edited by
    #1

    Hi, In vb6, there would be an Option Group control that could contain a set of buttons, or boxes etc. Values would be assigned to control, and Select Case statements could be created based on the Option Group control. The only thing I could find in VStudio/VB.net is the groupbox control. Here is what I have: Select Case GroupBox1.Controls Case RadioButton1 MessageBox.Show("button1 selected") Case RadioButton2 MessageBox.Show("button2 selected") End Select For the Case RadioButton1 and 2, I receive a message, "Operator '=' is not defined for types System.Windows.Forms.Control.ControlCollection and boolean... Any suggestions is greatly apprciated. Rashar

    R 1 Reply Last reply
    0
    • R Rashar

      Hi, In vb6, there would be an Option Group control that could contain a set of buttons, or boxes etc. Values would be assigned to control, and Select Case statements could be created based on the Option Group control. The only thing I could find in VStudio/VB.net is the groupbox control. Here is what I have: Select Case GroupBox1.Controls Case RadioButton1 MessageBox.Show("button1 selected") Case RadioButton2 MessageBox.Show("button2 selected") End Select For the Case RadioButton1 and 2, I receive a message, "Operator '=' is not defined for types System.Windows.Forms.Control.ControlCollection and boolean... Any suggestions is greatly apprciated. Rashar

      R Offline
      R Offline
      Raistlin21_45
      wrote on last edited by
      #2

      You could use somthing like this; Sub SetControlArray() Dim Radio(6) as RadioButton Radio(0) = RadioButton1 Radio(1) = RadioButton2 Radio(2) = RadioButton3 Radio(3) = RadioButton4 Radio(4) = RadioButton5 Radio(5) = RadioButton6 End Sub Then use a For... Next to do what you want. Hope this helps. For every action there is an equal and opposite malfunction

      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