?
Solved

Working with RadioButtons in VB.NET

Posted on 2005-04-21
6
Medium Priority
?
167 Views
Last Modified: 2010-04-23
I have a form with two radio buttons ( ADD and DELETE ) in a group ( SELECTION). When the use selects any button, the value should be displayed in a messageBoX alon with the name of the button(ADD or delete in this case) and sore that value in a new string.Can you please help me?
0
Comment
Question by:g46905
  • 3
  • 3
6 Comments
 
LVL 13

Expert Comment

by:Torrwin
ID: 13836405
Is this a homework assignment?  We're here to assist, not write the program for you. =)
0
 

Author Comment

by:g46905
ID: 13836437
I am new to VB.NET technology and having issues while using controls

Thanks,
0
 
LVL 13

Expert Comment

by:Torrwin
ID: 13836473
Ok, so what do you have written so far?  Where are you stuck?  If you post what you have written we'll be able to help you better.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:g46905
ID: 13836508
I have marked the arrow where I am stuck.As I am new to this technology, I am sure the task might sound simple or silly.
But I guess we all have to start somewhere.Thanks for your patience and cooperation.


Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click
        'call user set
        Dim usr As User = New User
        If (Me.cmbRole.SelectedIndex > -1) Then
        usr.USER_TYPE = Me.cmbRole.SelectedItem
        End If
        Dim item As Control

        For Each item In Me.GroupBox1.Controls
            If DirectCast(item, RadioButton).Checked Then
                MsgBox("Radio button is checked!") <----------------------it should diplay the name of the radio button selected
            End If
        Next item

        usr.WP_USER_ID = 6 'Me.tbUserId
        usr.TNUMBER = Me.tbUserId.Text.Trim
        User.SetUser(usr)

Thanks again
0
 
LVL 13

Accepted Solution

by:
Torrwin earned 400 total points
ID: 13836654
For Each item In Me.GroupBox1.Controls
            If DirectCast(item, RadioButton).Checked Then
                MsgBox(item.Text & " is checked!")
            End If
Next item
0
 

Author Comment

by:g46905
ID: 13836698
I really appreciate you for the immediate response.Thanks for your help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 10 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question