public void SetButton(int index) { Button[] btnarr = new Button[] { One, Two, Three, Four, Five, Six }; foreach (Button btn in btnarr) { if (btn.InvokeRequired) { SetButtonIndex d = new SetButtonIndex(SetButton); tv.Invoke(d, new object[] { }); } else { btn.BackColor = Color.White; } } if (index == 1) { Transactions_View.SetButtonColor(One, Color.Yellow); } if (index == 2) { Transactions_View.SetButtonColor(Two, Color.Yellow); } if (index == 3) { Transactions_View.SetButtonColor(Three, Color.Yellow); } if (index == 4) { Transactions_View.SetButtonColor(Four, Color.Yellow); } if (index == 5) { Transactions_View.SetButtonColor(Five, Color.Yellow); } if (index == 6) { Transactions_View.SetButtonColor(Six, Color.Yellow); } }
public void SetButton(int index) { Button[] btnarr = new Button[] { One, Two, Three, Four, Five, Six }; foreach (Button btn in btnarr) { btn.BackColor = Color.White; } if (index == 1) { Transactions_View.SetButtonColor(One, Color.Yellow); } if (index == 2) { Transactions_View.SetButtonColor(Two, Color.Yellow); } if (index == 3) { Transactions_View.SetButtonColor(Three, Color.Yellow); } if (index == 4) { Transactions_View.SetButtonColor(Four, Color.Yellow); } if (index == 5) { Transactions_View.SetButtonColor(Five, Color.Yellow); } if (index == 6) { Transactions_View.SetButtonColor(Six, Color.Yellow); } }