private void ShowPanel(PanelEx panel, Button btnFocus) { panel.Parent = BackLayer; panel.Left = (mSize.Width - panel.Width) / 2; panel.Top = (mSize.Height - panel.Height) / 2 - 18; panel.Visible = true; BackLayer.Show(); btnFocus.Focus(); this.Refresh(); }
public override void ShowMessage(string message, MsgType mType) { //Hide other items on the layer RunPanel.Visible = false; MsgPanel.Parent = BackLayer; MsgPanel.Left = (mSize.Width - MsgPanel.Width) / 2; MsgPanel.Top = (mSize.Height - MsgPanel.Height) / 2; MsgPanelText.Text = message; BtnMsgOk.Select(); this.AcceptButton = BtnMsgOk; switch (mType) { case MsgType.Normal: MsgPanel.ShadowColor = Color.Chartreuse; MsgPic.Image = Resources.Success; break; case MsgType.Caution: MsgPanel.ShadowColor = Color.Orange; MsgPic.Image = Resources.Warning; break; case MsgType.Error: MsgPanel.ShadowColor = Color.Red; MsgPic.Image = Resources.ErrLarge; break; default: break; } MsgPanel.Visible = true; this.Refresh(); BackLayer.Show(); this.Refresh(); }