判断某个整型是否定义在枚举中:Enum.IsDefined(typeof(SyncTimeMethod), i));
绑定到ComboBox控件:cmbSyncMethod.DataSource = System.Enum.GetNames(typeof(SyncTimeMethod));
获取:(int)Enum.Parse(typeof(SyncTimeMethod), cmbSyncMethod.Text, false);
设置:cmbSyncMethod.Text = ((SyncTimeMethod)60).ToString();
时间: 2024-11-10 00:18:47