public class myconstants { public const double pi = 3.14159265; public string NameOfWeek(DaysOfWeek nDay) { switch(nDay) { case DaysOfWeek.Monday: return "Monday"; case DaysOfWeek.Tuesday: return "Tuesday"; case DaysOfWeek.Wednesday: return "Wednesday"; case DaysOfWeek.Thursday: return "Thursday"; case DaysOfWeek.Friday: return "Friday"; case DaysOfWeek.Saturday: return "Saturday"; case DaysOfWeek.Sunday: return "Sunday"; } return "Not a week day"; } } public enum DaysOfWeek { Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7 } // In keydon private void MainForm_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { myconstants oco = new myconstants(); MessageBox.Show(oco.NameOfWeek((DaysOfWeek)(char)e.KeyValue)); }
"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."
- Ephesians 4:29-30 NIV
Dare to Question -- Care to Answer
Time is like water in a sponge, as long as you are willing you can always squeeze some.
--Lu Xun, Father of Modern Chinese Literature