private void SetColor(ComboBox cbColor) { ColorDialog cd = new ColorDialog(); cd.AnyColor = true; cd.FullOpen = true; cd.CustomColors = RdlDesigner.GetCustomColors(); cd.Color = DesignerUtility.ColorFromHtml(cbColor.Text, System.Drawing.Color.Empty); try { if (cd.ShowDialog() != DialogResult.OK) { return; } RdlDesigner.SetCustomColors(cd.CustomColors); cbColor.Text = ColorTranslator.ToHtml(cd.Color); } finally { cd.Dispose(); } return; }
private void bColor_Click(object sender, System.EventArgs e) { ColorDialog cd = new ColorDialog(); cd.AnyColor = true; cd.FullOpen = true; cd.CustomColors = RdlDesigner.GetCustomColors(); cd.Color = DesignerUtility.ColorFromHtml(cbColor.Text, System.Drawing.Color.Black); try { if (cd.ShowDialog() != DialogResult.OK) { return; } RdlDesigner.SetCustomColors(cd.CustomColors); if (sender == this.bColor) { cbColor.Text = ColorTranslator.ToHtml(cd.Color); } } finally { cd.Dispose(); } return; }
private void bColor_Click(object sender, System.EventArgs e) { using (ColorDialog cd = new ColorDialog()) { cd.AnyColor = true; cd.FullOpen = true; cd.CustomColors = RdlDesigner.GetCustomColors(); if (cd.ShowDialog() != DialogResult.OK) { return; } RdlDesigner.SetCustomColors(cd.CustomColors); if (sender == this.bEndColor) { cbEndColor.Text = ColorTranslator.ToHtml(cd.Color); } else if (sender == this.bBackColor) { cbBackColor.Text = ColorTranslator.ToHtml(cd.Color); } } return; }