[C#] C#中枚举类型和radiobox关联操作代码 →→→→→进入此内容的聊天室

来自 , 2021-01-31, 写在 C#, 查看 127 次.
URL http://www.code666.cn/view/2f3c6a4c
  1. public MainForm()
  2.         {
  3.             //
  4.             // The InitializeComponent() call is required for Windows Forms designer support.
  5.             //
  6.             InitializeComponent();
  7.            
  8.             //
  9.             // TODO: Add constructor code after the InitializeComponent() call.
  10.             //
  11.             int idx = 0;
  12.             foreach(Control c in groupBox1.Controls)
  13.             {
  14.                 if(c is RadioButton)
  15.                 {
  16.                     ((RadioButton)c).Text  = ((星期)idx).ToString();
  17.                     ((RadioButton)c).Tag = ((星期)idx);
  18.                     idx++;
  19.                 }
  20.             }
  21.         }
  22.  
  23. //csharp/6143

回复 "C#中枚举类型和radiobox关联操作代码"

这儿你可以回复上面这条便签

captcha