I want to create a subset enums list from System.Windows.Forms.Keys, that only includes A-Z, 0-9, and F keys. Currently, I set the full list to a combo box on a winform:
comboBox1.DataSource = Enum.GetValues(typeof (System.Windows.Forms.Keys));
Is there a fast way to create this subset? My current workaround is to hardcode a list of acceptable keys:
private List<Keys> acceptableKeys = new List<Keys>
{
Keys.A,
Keys.B, Keys.C, Keys.D, Keys.E, Keys.F, Keys.G, Keys.H, Keys.I, Keys.J, Keys.K, Keys.L, Keys.M,
Keys.N, Keys.O, Keys.P, Keys.Q, Keys.R, Keys.S, etc....
};
and use that as the dataSource.
Is there a better method to do this?