请教高手short的问题,急,在线等 媒举对象Shortcut里面放的都是快捷键,现在我想把里面的所有元素加载到Combobox内,但是我不知道怎么得到他的集合!请高手指教!谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public class GetValuesTest { enum Colors { Red, Green, Blue, Yellow }; enum Styles { Plaid = 0, Striped = 23, Tartan = 65, Corduroy = 78 }; public static void Main() { Console.WriteLine("The values of the Colors Enum are:"); foreach(int i in Enum.GetValues(typeof(Colors))) Console.WriteLine(i); Console.WriteLine(); Console.WriteLine("The values of the Styles Enum are:"); foreach(int i in Enum.GetValues(typeof(Styles))) Console.WriteLine(i); } 同意楼上的,用foreach不就得到了吗? 程序没问题,可是根本问题阿,我现在要拿Shortcut快捷键里面的快捷键集合阿,看这里 foreach(string i in ((string[])Enum.GetValues(typeof(Shortcut)))) { MessageBox.Show(i); }根据你的方法,我这样写,可他出来的都是数字阿!根本拿不到快捷键,怎么办?我要拿出来以后放到combobox里面,怎么写呢?大哥帮帮忙,急阿! 上面会出错,按照你的写法应该是foreach(int i in Enum.GetValues(typeof(Shortcut))) { MessageBox.Show(i.tostring()); } 高分求.NET兼容Java的MD5WithRSA签名源码 关于 C# winform DragDrop 事件 有谁用flash做过在线录音的,帮忙解释一下 为什么用户控件中的格式不能显示 如何将一个查询,放到一个Table中? 如何实现这样的窗体效果:在屏幕边缘自动吸附或隐藏(收起) SQL如何清楚空格或换行符!!!!!!!!!!!送分!!!!!!!!!!!!! 一个关于Graphics类的问题 位图操作的一个问题 请高手解答性能计数器 在.NET环境下面怎么样把自己写的系统打包? 有关WINDOWS服务程序
enum Colors { Red, Green, Blue, Yellow };
enum Styles { Plaid = 0, Striped = 23, Tartan = 65, Corduroy = 78 }; public static void Main() { Console.WriteLine("The values of the Colors Enum are:");
foreach(int i in Enum.GetValues(typeof(Colors)))
Console.WriteLine(i); Console.WriteLine(); Console.WriteLine("The values of the Styles Enum are:");
foreach(int i in Enum.GetValues(typeof(Styles)))
Console.WriteLine(i);
}
看这里
foreach(string i in ((string[])Enum.GetValues(typeof(Shortcut))))
{
MessageBox.Show(i);
}
根据你的方法,我这样写,可他出来的都是数字阿!
根本拿不到快捷键,怎么办?我要拿出来以后放到combobox里面,怎么写呢?
大哥帮帮忙,急阿!
foreach(int i in Enum.GetValues(typeof(Shortcut)))
{
MessageBox.Show(i.tostring());
}