Computer Learning Zone CLZ Access Excel Word Windows

Education makes a people easy to lead but difficult to drive: easy to govern, but impossible to enslave.

-Peter Brougham
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > VB.NET > Radio Button Value
Radio Button Value
By Alex Hedley   11 years ago

Intermediate

I spent quite a bit of time trying to figure out how to get the Label text from a Radio Button and use it in my Code.

I wanted to change the type of Chart that was being displayed and wanted the user to have a set of options.

Add a Frame onto your Form. (GroupBox1)

Dim rButton As RadioButton

rButton = GroupBox1.Controls.OfType(Of RadioButton)()

    .Where(Function(r) r.Checked = True).FirstOrDefault()

ChosenChart = rButton.Text

Chart1.Series(Series1.Name).ChartType =

    [Enum].Parse(GetType(SeriesChartType), ChosenChart)


 

I tried the following but it didn't work.

'Chart1.Series(Series1.Name).ChartType = CType(ChosenChart, SeriesChartType)


 

Working With Charts? Add the following class.

Imports System.Windows.Forms.DataVisualization.Charting



Research

I found the following article which helped.

Chart1.Series(Series1.Name).ChartType = 
    DirectCast([Enum].Parse(GetType(SeriesChartType), ChosenChart, True), SeriesChartType)


 

Original

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Radio Button Value
Get notifications when this page is updated
 
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/11/2025 5:48:15 PM. PLT: 1s
Keywords: load, mdi, screen, vb, vbnet, vb.net  Page Tag: FORUMADMIN  PermaLink  Radio Button Value