private void ErrorForm_Load(object sender, EventArgs e) { this.KeyPreview = true; this.Text = string.Empty; this.ControlBox = false; this.DoubleBuffered = true; this.MaximizedBounds = Screen.FromHandle(this.Handle).WorkingArea; if (errormessage == "") { errormessage = " "; } this.lblError.Text = this.errormessage; GlobalFunc.CenterControlInParent(lblError, 38); }
private void DialogForm_Load(object sender, EventArgs e) { this.Text = this.Title; this.MessageLabel.Text = this.Message; this.YesButton.Text = this.YesButtonLabel; this.NoButton.Text = this.NoButtonLabel; this.KeyPreview = true; this.Text = string.Empty; this.ControlBox = false; this.DoubleBuffered = true; this.MaximizedBounds = Screen.FromHandle(this.Handle).WorkingArea; int buttonTopPosition = GlobalFunc.CenterControlInParent(MessageLabel, YesButton.Height); if (buttonTopPosition != 0) { YesButton.Top = buttonTopPosition; NoButton.Top = buttonTopPosition; } }