偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

深度看點 C# RadioButton實現(xiàn)方法

開發(fā) 后端
本文你具體介紹了C# RadioButton的幾個屬性,他們分別是Appearance屬性,Appearance屬性,Checked屬性,CheckedAlign屬性,并且介紹了具體的用法,希望對大家有所幫助。

C# RadioButton是大家經(jīng)常用的一個控件,其屬性之多,但是我們只需掌握其中幾個就可以了,下面將做一下簡單的介紹。

C# RadioButton單選按鈕一般用作一個組。

1.C# RadioButton只允許用戶從幾個選項中選擇一個,同一個容器中一次只能選擇一個按鈕;

2.C# RadioButton的Appearance屬性:根據(jù)的以下兩種取值控制外觀:
Normal:圓圈+標簽,選中后會填充圓圈;
Button:按鈕,類似于開關(guān),選中后按下,未選中時凸起;

3.C# RadioButton的Checked屬性:
  true:選中;
  false: 未選中;
4.C# RadioButton的CheckedAlign屬性:確定圓圈與標簽文本的相對位置。

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.ComponentModel;  
  4. using System.Data;  
  5. using System.Drawing;  
  6. using System.Text;  
  7. using System.Windows.Forms;  
  8. namespace TestRadioButton  
  9. {  
  10.     public partial class Form1 : Form  
  11.     {  
  12.         public Form1()  
  13.         {  
  14.             InitializeComponent();  
  15.         }  
  16.             private void button1_Click(object sender, EventArgs e)  
  17.         {  
  18.             string checkedRBName = "";  
  19.               
  20.             //取得選中單選按鈕的名稱  
  21.             if (radioButton1.Checked)  
  22.             {  
  23.                 checkedRBName = radioButton1.Name;  
  24.             }  
  25.             else if (radioButton2.Checked)  
  26.             {  
  27.                 checkedRBName = radioButton2.Name;  
  28.             }  
  29.             else 
  30.             {  
  31.                 checkedRBName = radioButton3.Name;  
  32.             }  
  33.             MessageBox.Show(checkedRBName + " was checked.");  
  34.         }  
  35.     }  
  36. }  

以上就是對C# RadioButton的簡單介紹。

【編輯推薦】

  1. 探尋C# Button雙擊事件
  2. 實現(xiàn)方法 C# button快捷鍵
  3. 如何實現(xiàn)C# button定義熱鍵
  4. 深度剖析 C# get post實現(xiàn)方法
  5. C# get post的原理與用法介紹
責(zé)任編輯:阡陌 來源: J2EE學(xué)習(xí)備忘錄
相關(guān)推薦

2009-09-10 17:37:01

C# get post

2009-08-19 17:00:07

C#實現(xiàn)PrintPa

2009-08-20 14:22:17

C#實現(xiàn) Contro

2009-09-07 09:36:29

C# DisposeDispose方法

2024-05-16 12:33:37

C#編程指針

2009-09-10 18:06:25

C# button快捷

2009-08-26 18:11:52

前臺與后臺方法互調(diào)

2009-04-20 10:09:46

C#優(yōu)先隊列.NET Framew

2009-08-25 14:26:28

C#播放AVI文件

2009-09-02 18:53:28

C#鼠標坐標

2009-08-26 17:16:22

C# CheckSta

2009-08-17 17:40:53

C# GetAllCu

2009-08-26 09:50:08

C# GreetPeo

2024-05-23 08:40:21

C#List映射工具

2009-09-11 09:59:47

2009-08-20 16:28:45

C#匿名方法

2009-08-10 17:36:17

C#擴展方法

2009-08-20 16:15:19

C# 匿名方法

2009-08-24 16:08:45

C# DrawStri

2009-09-10 14:52:55

C# get
點贊
收藏

51CTO技術(shù)棧公眾號