public static void CheckControlRole(ControlCollection cc) { foreach (System.Web.UI.Control c in cc) { if (c.HasControls()) { CheckControlRole(c.Controls); } else { if (c is XUIButton) { XUIButton btn = ((XUIButton)c); if (CheckRole(btn.RoleCode)) { btn.Enabled = true; } else if (btn.RoleCode == "") { btn.Enabled = true; } else { btn.Enabled = false; //btn.BackColor = System.Drawing.Color.Red; btn.ForeColor = System.Drawing.Color.SlateGray; } } } } }
/*--- 啟用狀態 ---*/ public static void ButtonEnable(XUIButton btn) { btn.Enabled = true; btn.BackgroundColor = Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(71)))), ((int)(((byte)(71))))); btn.TextColor = Color.White; }
/*------ Button *-『ButtonDisable』:禁用狀態 *-『ButtonEnable』:啟用狀態 *-----------------------------------*/ /*--- 禁用狀態 ---*/ public static void ButtonDisable(XUIButton btn) { btn.Enabled = false; btn.BackgroundColor = Color.FromArgb(((int)(((byte)(47)))), ((int)(((byte)(52)))), ((int)(((byte)(60))))); btn.TextColor = Color.FromArgb(((int)(((byte)(108)))), ((int)(((byte)(108)))), ((int)(((byte)(108))))); }
/*--- 禁用按鈕『報名列』---*/ private void DisableBtn_signUpList(XUIButton btn) { btn.Enabled = false; btn.BackgroundColor = Color.FromArgb(((int)(((byte)(132)))), ((int)(((byte)(98)))), ((int)(((byte)(73))))); btn.TextColor = Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(62)))), ((int)(((byte)(42))))); }
/*--- 啟用按鈕『報名列』---*/ private void EnableBtn_signUpList(XUIButton btn) { btn.Enabled = true; btn.BackgroundColor = Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(135)))), ((int)(((byte)(84))))); btn.TextColor = Color.White; }
public static void SetClickedBackground(XUIButton button, Color color) { button.BackgroundColor = color; }