TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tomas Westerlund
NA
38
32.5k
How to know which RadioButton that is selected?
Aug 24 2011 4:28 AM
Hi,
I am working on an assignment from the "Head First C#" book.
I have three radio buttons (joeRButton, bobRButton and alRButton).
I also has an array with an instance of an class named Guy. Every Guy (Joe, Bob and Al) has an instance of this class i.e. Guy[] guy = new Guy[3]. So far so good!
I want to know which radio button is checked when I press a button so I can do some stuff. However I don't want to do "if joeRButton.checked = true DO THIS, if bobRButton.checked = true DO THIS", I want it do be more dynamic.
Each radio button is assigned to their instance (guy[0] = new Guy() { Name = "Joe", Cash = 100, MyLabel = joeBox, MyRadioButton = joeRButton })
Can anyone help me with this?
Reply
Answers (
1
)
How to connect two computers through windows application?
Get data from gridview - please help