public void SetSizeButtonOn(SizeButtons button) { Button b = null; switch (button) { case SizeButtons.小号: b = smallBtn; fontSize = 2; break; case SizeButtons.中号: b = middleBtn; fontSize = 5; break; case SizeButtons.大号: fontSize = 10; b = bigBtn; break; } b.BackColor = Color.Wheat; Button[] buttons = { smallBtn, middleBtn, bigBtn }; foreach (Button c in buttons) { if (c != b) { c.BackColor = Color.Transparent; } } }
public SettingPan(SizeButtons size, ColorButtons color) { InitializeComponent(); SetSizeButtonOn(size); SetColorButtonOn(color); }