private void InitializeComponent() { /*Graphics g = CreateGraphics(); SizeF textSize = g.MeasureString(confirmMessage, Font);*/ lblMessage = new Label(); lblMessage.Font = Font; lblMessage.ForeColor = Color.White; lblMessage.BackColor = Color.Transparent; lblMessage.AutoSize = true; lblMessage.Text = confirmMessage; Int32 x = (Width/2) - (lblMessage.Width/2); lblMessage.Location = new Point(x, MaxButtonHeight); btnOk = new AkuButton(AkuColor.DefaultBeginColor); btnOk.Location = new Point(0, Height - MaxButtonHeight); btnOk.Name = "btnOk"; btnOk.Size = new Size((Width / 2) + 1, MaxButtonHeight); btnOk.Text = "Ok"; btnOk.Click += (sender, args) => { dialogResult = DialogResult.OK; Close(); }; btnCancel = new AkuButton(AkuColor.DefaultBeginColor); btnCancel.Location = new Point(btnOk.Width - 1, Height - MaxButtonHeight); btnCancel.Name = "btnCancel"; btnCancel.Size = new Size((Width / 2), MaxButtonHeight); btnCancel.Text = "Cancel"; btnCancel.Click += (sender, args) => { dialogResult = DialogResult.Cancel; Close(); }; Controls.Add(lblMessage); Controls.Add(btnOk); Controls.Add(btnCancel); }
private void InitializeComponent() { /*Graphics g = CreateGraphics(); * SizeF textSize = g.MeasureString(confirmMessage, Font);*/ lblMessage = new Label(); lblMessage.Font = Font; lblMessage.ForeColor = Color.White; lblMessage.BackColor = Color.Transparent; lblMessage.AutoSize = true; lblMessage.Text = confirmMessage; Int32 x = (Width / 2) - (lblMessage.Width / 2); lblMessage.Location = new Point(x, MaxButtonHeight); btnOk = new AkuButton(AkuColor.DefaultBeginColor); btnOk.Location = new Point(0, Height - MaxButtonHeight); btnOk.Name = "btnOk"; btnOk.Size = new Size((Width / 2) + 1, MaxButtonHeight); btnOk.Text = "Ok"; btnOk.Click += (sender, args) => { dialogResult = DialogResult.OK; Close(); }; btnCancel = new AkuButton(AkuColor.DefaultBeginColor); btnCancel.Location = new Point(btnOk.Width - 1, Height - MaxButtonHeight); btnCancel.Name = "btnCancel"; btnCancel.Size = new Size((Width / 2), MaxButtonHeight); btnCancel.Text = "Cancel"; btnCancel.Click += (sender, args) => { dialogResult = DialogResult.Cancel; Close(); }; Controls.Add(lblMessage); Controls.Add(btnOk); Controls.Add(btnCancel); }
private void InitializeComponent() { lblMessage = new Label(); lblMessage.Font = Font; lblMessage.ForeColor = Color.White; lblMessage.BackColor = Color.Transparent; lblMessage.AutoSize = true; lblMessage.Text = alertMessage; Int32 x = (Width/2) - (lblMessage.Width/2); Int32 y = (Height/2) - (lblMessage.Height/2); lblMessage.Location = new Point(x, MaxButtonHeight); btnOk = new AkuButton(AkuColor.DefaultBeginColor); btnOk.Location = new Point(0, Height - MaxButtonHeight); btnOk.Name = "btnOk"; btnOk.Size = new Size(Width, MaxButtonHeight); btnOk.Text = "Ok"; btnOk.Click += (sender, args) => Close(); Controls.Add(lblMessage); Controls.Add(btnOk); }
private void InitializeComponent() { lblMessage = new Label(); lblMessage.Font = Font; lblMessage.ForeColor = Color.White; lblMessage.BackColor = Color.Transparent; lblMessage.AutoSize = true; lblMessage.Text = alertMessage; Int32 x = (Width / 2) - (lblMessage.Width / 2); Int32 y = (Height / 2) - (lblMessage.Height / 2); lblMessage.Location = new Point(x, MaxButtonHeight); btnOk = new AkuButton(AkuColor.DefaultBeginColor); btnOk.Location = new Point(0, Height - MaxButtonHeight); btnOk.Name = "btnOk"; btnOk.Size = new Size(Width, MaxButtonHeight); btnOk.Text = "Ok"; btnOk.Click += (sender, args) => Close(); Controls.Add(lblMessage); Controls.Add(btnOk); }
private void InitializeComponent() { lblMessage = new Label(); lblMessage.Font = Font; lblMessage.ForeColor = Color.White; lblMessage.BackColor = Color.Transparent; lblMessage.AutoSize = true; lblMessage.Text = promptMessage; Int32 x = (Width / 2) - (lblMessage.Width / 2); lblMessage.Location = new Point(x, MaxButtonHeight); txtResult = new TextBox(); txtResult.Font = Font; txtResult.BackColor = Color.White; txtResult.ForeColor = Color.DarkGray; txtResult.BorderStyle = BorderStyle.FixedSingle; txtResult.Size = new Size(Width - 10, 25); txtResult.Location = new Point(10, MaxButtonHeight + lblMessage.Height + 10); btnOk = new AkuButton(AkuColor.DefaultBeginColor); btnOk.Location = new Point(0, Height - MaxButtonHeight); btnOk.Size = new Size((Width / 2) + 1, MaxButtonHeight); btnOk.Text = "Ok"; btnOk.Click += (sender, args) => { dialogResult = txtResult.Text; Close(); }; btnCancel = new AkuButton(AkuColor.DefaultBeginColor); btnCancel.Location = new Point(btnOk.Width - 1, Height - MaxButtonHeight); btnCancel.Size = new Size((Width / 2), MaxButtonHeight); btnCancel.Text = "Cancel"; btnCancel.Click += (sender, args) => { dialogResult = null; Close(); }; Controls.Add(lblMessage); Controls.Add(txtResult); Controls.Add(btnOk); Controls.Add(btnCancel); }
private void InitializeComponent() { lblMessage = new Label(); lblMessage.Font = Font; lblMessage.ForeColor = Color.White; lblMessage.BackColor = Color.Transparent; lblMessage.AutoSize = true; lblMessage.Text = promptMessage; Int32 x = (Width/2) - (lblMessage.Width/2); lblMessage.Location = new Point(x, MaxButtonHeight); txtResult = new TextBox(); txtResult.Font = Font; txtResult.BackColor = Color.White; txtResult.ForeColor = Color.DarkGray; txtResult.BorderStyle = BorderStyle.FixedSingle; txtResult.Size = new Size(Width - 10, 25); txtResult.Location = new Point(10, MaxButtonHeight + lblMessage.Height + 10); btnOk = new AkuButton(AkuColor.DefaultBeginColor); btnOk.Location = new Point(0, Height - MaxButtonHeight); btnOk.Size = new Size((Width / 2) + 1, MaxButtonHeight); btnOk.Text = "Ok"; btnOk.Click += (sender, args) => { dialogResult = txtResult.Text; Close(); }; btnCancel = new AkuButton(AkuColor.DefaultBeginColor); btnCancel.Location = new Point(btnOk.Width - 1, Height - MaxButtonHeight); btnCancel.Size = new Size((Width / 2), MaxButtonHeight); btnCancel.Text = "Cancel"; btnCancel.Click += (sender, args) => { dialogResult = null; Close(); }; Controls.Add(lblMessage); Controls.Add(txtResult); Controls.Add(btnOk); Controls.Add(btnCancel); }