Пример #1
0
 private void HighlightActiveButton(RoutineButton activeButton)
 {
     foreach (RoutineButton button in mRoutines.Values)
     {
         button.Button.BackColor = Color.LightGray;
     }
     activeButton.Button.BackColor = Color.LightBlue;
 }
Пример #2
0
        private void AddRoutine(string name, ScriptRoutine routine)
        {
            Button button = new Button();
            button.Text = name;
            button.Click += new EventHandler(RoutineButtonSelected);
            button.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right)));

            RoutineButton routineButton = new RoutineButton();
            routineButton.Button = button;
            routineButton.Routine = routine;

            mActiveRoutine = new KeyValuePair<int, RoutineButton>(mRoutines.Count, routineButton);
            SetActiveRoutine();

            mRoutines.Add(mRoutines.Count, routineButton);
            button.Width = mScriptRoutinesPanel.Width;
            mScriptRoutinesPanel.Controls.Add(button);

            OrderRoutines();
        }