In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the knowledge of "example usage of RadioButton in C#". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
C # RadioButton is a control that we often use, with so many properties, but we only need to master a few of them. Here is a brief introduction.
The C # RadioButton radio button is typically used as a group.
1.C# RadioButton allows users to select only one of several options, and can only select one button at a time in the same container.
The Appearance property of 2.C# RadioButton: controls the appearance based on the following two values:
Normal: circle + label, which will fill the circle when selected
Button: button, similar to a switch, pressed when selected and raised when unchecked
Checked attribute of 3.C# RadioButton:
True: selected
False: not selected
The CheckedAlign property of 4.C# RadioButton: determines the relative position of the circle to the label text.
Using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace TestRadioButton {public partial class Form1: Form {public Form1 () {InitializeComponent ();} private void button1_Click (object sender, EventArgs e) {string checkedRBName = "" / / get the name of the selected radio button if (radioButton1.Checked) {checkedRBName = radioButton1.Name;} else if (radioButton2.Checked) {checkedRBName = radioButton2.Name } else {checkedRBName = radioButton3.Name;} MessageBox.Show (checkedRBName + "was checked.");}} "instance usage of RadioButton in C#" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.