/// <summary> /// Called when the Add Split button is pressed. /// </summary> private void addSplitButton_Click(object sender, EventArgs e) { SplitControl newSplit = new SplitControl(this, splitControls.Count + 1); if (splitControls.Count > 0) { SplitControl control = (SplitControl)splitControls.Last(); newSplit.Location = control.Location.Add(spacing); control.ToggleDown(true); } newSplit.ToggleUp(splitControls.Count > 0); newSplit.ToggleDown(false); splitControls.Add(newSplit); UpdateCountLabel(); }
/// <summary> /// Toggles up/down buttons on the given split control based on the given index. /// </summary> private void ToggleButtons(SplitControl control, int index) { control.ToggleUp(index > 0); control.ToggleDown(index < splitControls.Count - 1); }