private void btnBackground_Click(object sender, System.EventArgs e) { try { using (ChooseColorDialog dialog = new ChooseColorDialog()) { dialog.ColorProperty = this.generalProperties.BackColor; dialog.UpdateDrawing += new UpdateDrawing(OnUpdateDrawing); XColor oldColor = this.generalProperties.BackColor.Color; if (dialog.ShowDialog(XGraphicsLab.mainForm) != DialogResult.OK) { this.generalProperties.BackColor.Color = oldColor; OnUpdateDrawing(); } } } catch {} }
private void Color2Button_Click(object sender, EventArgs e) { ChooseColorDialog.Color = GetBackColor2(); ChooseColorDialog.ShowDialog(this); SetBackColor2(ChooseColorDialog.Color); }