C#枚举绑定到combobox
2021-05-13 20:28
标签:sys parse source string eof get getname system method 判断某个整型是否定义在枚举中:Enum.IsDefined(typeof(SyncTimeMethod), i)); C#枚举绑定到combobox 标签:sys parse source string eof get getname system method 原文地址:http://www.cnblogs.com/zh33gl/p/7531856.html
绑定到ComboBox控件:cmbSyncMethod.DataSource = System.Enum.GetNames(typeof(SyncTimeMethod));
获取:(int)Enum.Parse(typeof(SyncTimeMethod), cmbSyncMethod.Text, false);
设置:cmbSyncMethod.Text = ((SyncTimeMethod)60).ToString();