对于enum类型:

使用foreach遍历enum类型的元素并填充combox

foreach ( HatchStyle hs1 in Enum.GetValues(typeof(HatchStyle)))
 {
     comboBox1.Items.Add(hs1.ToString());
 }
From a string: YourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString);
From an int: YourEnum foo = (YourEnum)yourInt;
From number you can also: YourEnum foo = Enum.ToObject(typeof(YourEnum) , yourInt);
 
_cmbOriginType.SelectedIndex = (int)SnappingTypes.用户指定;

相关文章:

  • 2022-12-23
  • 2022-03-05
  • 2021-06-05
  • 2022-03-09
  • 2022-01-04
  • 2021-07-17
  • 2021-07-14
  • 2022-01-10
猜你喜欢
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案