private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == (Keys.Q | Keys.Control)) { ArrayList viewmodeList = new ArrayList(Enum.GetValues(typeof(Gravitybox.Controls.Schedule.ViewModeConstants))); Gravitybox.Controls.Schedule.ViewModeConstants viewmode = schedule1.ViewMode; if (viewmodeList.IndexOf(viewmode) == viewmodeList.Count - 1) { schedule1.ViewMode = (Gravitybox.Controls.Schedule.ViewModeConstants)viewmodeList[0]; } else { schedule1.ViewMode = (Gravitybox.Controls.Schedule.ViewModeConstants)viewmodeList[viewmodeList.IndexOf(viewmode) + 1]; } } }
private void cmdViewmode_Click(object sender, EventArgs e) { List <string> valueList = new List <string>(Enum.GetNames(typeof(Gravitybox.Controls.Schedule.ViewModeConstants))); int index = valueList.IndexOf(schedule1.ViewMode.ToString()); if (index < valueList.Count - 1) { index++; } else { index = 0; } Gravitybox.Controls.Schedule.ViewModeConstants value = (Gravitybox.Controls.Schedule.ViewModeConstants)Enum.Parse(typeof(Gravitybox.Controls.Schedule.ViewModeConstants), valueList[index]); schedule1.ViewMode = value; lblText.Text = index.ToString() + ") " + schedule1.ViewMode.ToString(); }
private void ViewModeMenuClick(object sender, EventArgs e) { Gravitybox.Controls.Schedule.ViewModeConstants viewmode = (Gravitybox.Controls.Schedule.ViewModeConstants)Enum.Parse(typeof(Gravitybox.Controls.Schedule.ViewModeConstants), ((MenuItem)sender).Text); schedule1.ViewMode = viewmode; }