private void ButtonCGBackColor_Click(object sender, RoutedEventArgs e) { ButtonCGBackColor.IsChecked = false; ColorDialog cd = new ColorDialog(); cd.CustomColors = CustomColors; cd.Color = ColorConvent(((SolidColorBrush)ButtonCGBackColor.Background).Color); if (cd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ButtonCGBackColor.Background = new SolidColorBrush(ColorConvent(cd.Color)); } //储存自定义颜色 CustomColors = cd.CustomColors; cd.Dispose(); TextBox1.Selection.ApplyPropertyValue(TextElement.BackgroundProperty, ButtonCGBackColor.Background); }
private void AttributeTable_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { if (AttributeTable.Rows[e.RowIndex].Cells[0].Style.BackColor != Color.White) { ColorDialog sDialog = new ColorDialog(); sDialog.Color = AttributeTable.Rows[e.RowIndex].Cells[0].Style.BackColor; if (sDialog.ShowDialog(this) == DialogResult.OK) { AttributeTable.Rows[e.RowIndex].Cells[0].Style.BackColor = sDialog.Color; } sDialog.Dispose(); } } }
// Set background color --------------------------------------------------------------------- private void pictureBoxBack_Click(object sender, EventArgs e) { ColorDialog ColorDialog = new ColorDialog { AllowFullOpen = true, //ShowHelp = true; Color = pictureBoxBack.BackColor }; if (ColorDialog.ShowDialog() == DialogResult.OK) { pictureBoxBack.BackColor = ColorDialog.Color; } ColorDialog.Dispose(); }
private void labelBackColor_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); cd.Color = labelBackColor.BackColor; cd.ShowDialog(); ColorBack = cd.Color; labelBackColor.BackColor = ColorBack; cd.Dispose(); cd = null; _configHelper.Write("BackColor", ColorBack.Name.ToString()); ReloadConfigParameters(); DrawLyric(); }
private void labelVerseNumberColor_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); cd.Color = labelVerseNumberColor.BackColor; cd.ShowDialog(); ColorVerseNumber = cd.Color; labelVerseNumberColor.BackColor = ColorVerseNumber; cd.Dispose(); cd = null; _configHelper.Write("VerseNumberColor", ColorVerseNumber.Name.ToString()); ReloadConfigParameters(); ShowLectionContent(); }
private void InterfaceColorBtn_Click(object sender, System.EventArgs e) { ColorDialog Colorpicker = new ColorDialog { Color = Globals.Colors.PRIMARY_Main, AnyColor = true, AllowFullOpen = true }; if (Colorpicker.ShowDialog() == DialogResult.OK) { InterfaceColorPick.BackColor = Colorpicker.Color; GeneralSettings.AppColor = Colorpicker.Color.Serialize(); } Colorpicker.Dispose(); }
/// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } if (colorDialog != null) { colorDialog.Dispose(); } } base.Dispose(disposing); }
private void btnColorDialog_Click(object sender, EventArgs e) { ColorDialog dialog = new ColorDialog(); dialog.Color = Color.FromArgb(trackBarRed.Value, trackBarGreen.Value, trackBarBlue.Value); dialog.AnyColor = true; dialog.FullOpen = true; if (dialog.ShowDialog() == DialogResult.OK) { trackBarRed.Value = dialog.Color.R; trackBarGreen.Value = dialog.Color.G; trackBarBlue.Value = dialog.Color.B; ColourSlidersUpdated(); UpdateNumberFromScrollBars(); } dialog.Dispose(); }
private void mnuFeather_Click(object sender, EventArgs e) { if (this.selectedImage == null) { return; } ColorDialog colorDialog = new ColorDialog(); DialogResult result = colorDialog.ShowDialog(); if (result == DialogResult.OK) { Effects.FeatherImage(this.SelectedImage, colorDialog.Color); this.picBoxMain.Invalidate(); colorDialog.Dispose(); // Gargabge Collection System.GC.Collect(); } }
private Color GetDlgColor(Color cDefault) { ColorDialog cd = new ColorDialog(); Color col = cDefault; cd.AllowFullOpen = true; cd.FullOpen = true; cd.Color = cDefault; if (cd.ShowDialog() == DialogResult.OK) { col = cd.Color; } //Clear up cd.Dispose(); //Return color return(col); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [Curtis_Beard] 11/18/2005 Created /// </history> private void moreColorsButton_Click(object sender, System.EventArgs e) { ColorDialog colDialog = new ColorDialog(); colDialog.FullOpen = true; __showingCustom = true; colDialog.Color = SelectedColor; if (colDialog.ShowDialog(this) == DialogResult.OK) { SelectedColor = colDialog.Color; } colDialog.Dispose(); __showingCustom = false; this.Close(); }
/// <summary> /// Shows a color picker to set the background color. /// It will redraw the image to match the new background color. /// </summary> private void btnSelectColor_Click(object sender, EventArgs e) { ColorDialog colorDialog = new ColorDialog(); colorDialog.AllowFullOpen = true; colorDialog.AnyColor = true; colorDialog.Color = _BackColor; colorDialog.FullOpen = true; colorDialog.ShowHelp = true; colorDialog.SolidColorOnly = false; if (colorDialog.ShowDialog() == DialogResult.OK) { _BackColor = colorDialog.Color; ResizeAndDisplayImage(); } colorDialog.Dispose(); }
private void OnFillColor ( object sender, EventArgs e ) { // dialog box ColorDialog Dialog = new ColorDialog(); Dialog.AllowFullOpen = true; Dialog.FullOpen = true; Dialog.SolidColorOnly = true; Dialog.AnyColor = true; Dialog.Color = ((Button)sender).BackColor; if (Dialog.ShowDialog(this) == DialogResult.OK) { ((Button)sender).BackColor = Dialog.Color; } Dialog.Dispose(); }
private void ChangeBotJuryBarColorButton_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); cd.AllowFullOpen = true; cd.ShowHelp = true; cd.Color = sndJuryBarColor; if (cd.ShowDialog() == DialogResult.OK) { sndJuryBarColor = cd.Color; JuryBarList[1].SetColor(cd.Color); DrawJuryBars(); } else { DrawJuryBars(); } cd.Dispose(); }
private void ButtonOAFontColor_Click(object sender, RoutedEventArgs e) { ButtonOAFontColor.IsChecked = false; ColorDialog cd = new ColorDialog(); cd.CustomColors = CustomColors; cd.Color = ColorConvent(LPTED.OADisplay.FontColor); if (cd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LPTED.SavePage(NowPage);//先保存 LPTED.OADisplay.FontColor = ColorConvent(cd.Color); ButtonOAFontColor.Background = new SolidColorBrush(LPTED.OADisplay.FontColor); LPTED.DisplaySource(NowPage);//重新加载 //重新绘制全部图片 RefreshLeftPanelAll(); } //储存自定义颜色 CustomColors = cd.CustomColors; cd.Dispose(); }
private void pCor_MouseDoubleClick(object sender, MouseEventArgs e) { ColorDialog d = new ColorDialog(); d.Color = pCor.BackColor; d.AllowFullOpen = true; d.FullOpen = true; d.AnyColor = true; if (d.ShowDialog() != DialogResult.Cancel) { SolidBrush b = new SolidBrush(d.Color); if (!paleta.Contains(b)) { paleta.Add(b); montaPaleta(); sCor = paleta.Count - 1; exibeCor(); } } d.Dispose(); }
private static void SetColor(ref Button button) { var isBackground = (ModifierKeys & Keys.Alt) == Keys.Alt; var color = isBackground ? button.BackColor : button.ForeColor; var dialog = new ColorDialog(); dialog.Color = color; dialog.FullOpen = true; dialog.SolidColorOnly = false; if (dialog.ShowDialog() == DialogResult.OK) { color = dialog.Color; } dialog.Dispose(); if (isBackground) { button.BackColor = color; } else { button.ForeColor = color; } }
private void ChangeTopPointBarColorButton_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); cd.AllowFullOpen = true; cd.ShowHelp = true; cd.Color = PointBarColor; if (cd.ShowDialog() == DialogResult.OK) { PointBarColor = cd.Color; for (int i = 0; i < 9; i++) { PointBarList[i].SetColor(cd.Color); } DrawPointBars(); } else { DrawPointBars(); } cd.Dispose(); }
/// <summary> /// 背景色の変更ボタンのクリックイベント /// </summary> private void ChangeBackgroundColorToolStripMenuItem_Click(object sender, EventArgs e) { // シャッフル中の場合はそのままリターンする if (this.State == PuzzleState.SHUFFLE) { return; } // ゲームプレイ中の場合は一時停止にする if (this.State == PuzzleState.PLAYING) { this.SetState(PuzzleState.STOP); } ColorDialog cd = new ColorDialog(); cd.Color = BoardPanel.BackColor; cd.AllowFullOpen = true; cd.SolidColorOnly = true; if (cd.ShowDialog() == DialogResult.OK) { Graphics g = Graphics.FromImage(this.ChangeBackgroundColorToolStripMenuItem.Image); g.FillRectangle(new SolidBrush(cd.Color), 1, 1, 14, 14); g.Dispose(); this.BoardPanel.BackColor = cd.Color; } // 一時停止の場合はゲームプレイ中に戻す if (this.State == PuzzleState.STOP) { this.SetState(PuzzleState.PLAYING); } cd.Dispose(); }
private void Menú_Contextual_Seleccionar_Color_Fuente_Click(object sender, EventArgs e) { try { ColorDialog Diálogo_Color = new ColorDialog(); Diálogo_Color.AllowFullOpen = true; Diálogo_Color.AnyColor = true; Diálogo_Color.Color = Variable_Color_ARGB_Fuente; Diálogo_Color.CustomColors = new int[16] { 255, 65535, 65280, 16776960, 16711680, 16711935, 0, 16777215, 128, 32896, 32768, 8421376, 8388608, 8388736, 8421504, 12632256 }; Diálogo_Color.FullOpen = true; Diálogo_Color.SolidColorOnly = false; if (Diálogo_Color.ShowDialog(this) == DialogResult.OK) { Variable_Color_ARGB_Fuente = Color.FromArgb(255, Diálogo_Color.Color.R, Diálogo_Color.Color.G, Diálogo_Color.Color.B); Registro_Guardar_Opciones(); Generar_Imágenes_Nombre(ComboBox_Palabras.Text); } Diálogo_Color.Dispose(); Diálogo_Color = null; } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); Variable_Excepción_Total++; Variable_Excepción = true; } }
public static void InitializeComponents() { // Empty the temp folder for the new project files Resources.EmptyTempFolder(); // Clear paper from the controls LivePreview.paperReference.Controls.Clear(); if (colorDialog != null) { colorDialog.Dispose(); } colorDialog = new ColorDialog(); colorDialog.FullOpen = true; Paper.Initialize(); Fonts.Initialize(); Languages.Initialize(); Objects.Initialize(); LivePreview.UnSelect(); }
public OptionsForm() { InitializeComponent(); Ui ui = new(this); ui.Init(_table); ui.Init(_tabs); _tabs.Size = new(ui.XWidth(80), ui.XHeight(24)); ui.Init(_fontsColorsTab); ui.Init(_fontsColorsFlow); ui.Pad(_fontsColorsFlow); ui.Init(_rowFlow1); ui.Init(_codeFontFlow); ui.MarginRight(_codeFontFlow); ui.Init(_codeFontLabel); ui.Init(_codeFontButton, 35); ui.PadLeft(_codeFontButton, 1); ui.Init(_rowFlow2); ui.MarginTop(_rowFlow2); ui.Init(_editorColorsFlow); ui.MarginRight(_editorColorsFlow); ui.Init(_editorColorsLabel); ui.Init(_editorPlainColorButton, 35); ui.PadLeft(_editorPlainColorButton, 6); ui.Init(_editorKeywordColorButton, 35); ui.PadLeft(_editorKeywordColorButton, 6); ui.Init(_editorCommentColorButton, 35); ui.PadLeft(_editorCommentColorButton, 6); ui.Init(_editorStringColorButton, 35); ui.PadLeft(_editorStringColorButton, 6); ui.Init(_editorLineNumbersColorButton, 35); ui.PadLeft(_editorLineNumbersColorButton, 6); ui.Init(_editorBackgroundColorButton, 35); ui.PadLeft(_editorBackgroundColorButton, 6); ui.Init(_gridFontFlow); ui.Init(_gridFontLabel); ui.Init(_gridFontButton, 35); ui.PadLeft(_gridFontButton, 1); ui.Init(_gridColorsFlow); ui.Init(_gridColorsLabel); ui.Init(_gridPlainColorButton, 35); ui.PadLeft(_gridPlainColorButton, 6); ui.Init(_gridHeaderColorButton, 35); ui.PadLeft(_gridHeaderColorButton, 6); ui.Init(_gridLineColorButton, 35); ui.PadLeft(_gridLineColorButton, 6); ui.Init(_gridBackgroundColorButton, 35); ui.PadLeft(_gridBackgroundColorButton, 6); ui.Init(_resetFlow); ui.MarginTop(_resetFlow); ui.Init(_resetButton); ui.Init(_buttonFlow); ui.MarginTop(_buttonFlow); ui.Init(_okButton); ui.Init(_cancelButton); var x = UserOptions.Instance; _colors = x.GetColors(); _dataTableFont = x.GetDataTableFont(); _codeFont = x.GetCodeFont(); UpdateDataTableFontButton(); UpdateCodeFontButton(); _colorDialog = new() { AllowFullOpen = true, AnyColor = true, FullOpen = true, ShowHelp = false, }; Disposed += delegate { _colorDialog.Dispose(); }; }
/// <summary> /// 单元格点击事件 /// </summary> /// <param name="cell">单元格</param> /// <param name="mp">坐标</param> /// <param name="button">按钮</param> /// <param name="clicks">点击次数</param> /// <param name="delta">滚轮值</param> public override void onCellClick(FCGridCell cell, FCTouchInfo touchInto) { base.onCellClick(cell, touchInto); List <FCGridRow> rows = m_rows; int rowsSize = rows.Count; for (int i = 0; i < rowsSize; i++) { FCGridRow row = rows[i]; List <FCGridCell> cells = row.getCells(); int cellsSize = cells.Count; for (int j = 0; j < cellsSize; j++) { FCGridControlCell cCell = cells[j] as FCGridControlCell; if (cCell != null) { if (row == cell.Row) { cCell.Control.TextColor = FCDraw.FCCOLORS_TEXTCOLOR4; } else { cCell.Control.TextColor = FCColor.Text; } } } } if (touchInto.m_firstTouch) { if (touchInto.m_clicks == 1) { if (!cell.AllowEdit && cell is GridColorCell) { GridColorCell colorCell = cell as GridColorCell; ColorDialog colorDialog = new ColorDialog(); colorDialog.AllowFullOpen = true; colorDialog.AnyColor = true; colorDialog.SolidColorOnly = false; int a = 0, r = 0, g = 0, b = 0; FCColor.toArgb(Native.Paint, FCStr.convertStrToColor(colorCell.getString()), ref a, ref r, ref g, ref b); colorDialog.Color = Color.FromArgb(a, r, g, b); if (colorDialog.ShowDialog() == DialogResult.OK) { Color newColor = colorDialog.Color; a = newColor.A; r = newColor.R; g = newColor.G; b = newColor.B; colorCell.setString(FCStr.convertColorToStr(FCColor.argb(a, r, g, b))); FCGridCell nameCell = cell.Row.getCell("PROPERTYNAME"); if (nameCell != null) { m_designerDiv.saveUndo(); String name = nameCell.Name; String value = cell.Text; int targetsSize = m_targets.Count; for (int i = 0; i < targetsSize; i++) { FCView target = m_targets[i]; m_xml.setProperty(target, name, value); if (m_collectionWindow != null) { m_collectionWindow.onPropertyChanged(name, value); } target.update(); } //恢复正确的值 String rightValue = "", type = ""; for (int i = 0; i < targetsSize; i++) { m_targets[i].getProperty(name.ToLower(), ref rightValue, ref type); } cell.Text = rightValue; Native.update(); Native.invalidate(); } } colorDialog.Dispose(); } //字体单元格 else if (!cell.AllowEdit && cell is GridFontCell) { GridFontCell fontCell = cell as GridFontCell; FontDialog fontDialog = new FontDialog(); fontDialog.Font = getFont(FCStr.convertStrToFont(fontCell.getString())); if (fontDialog.ShowDialog() == DialogResult.OK) { Font newFont = fontDialog.Font; fontCell.setString(FCStr.convertFontToStr(new FCFont(newFont.Name, newFont.Size, newFont.Bold, newFont.Underline, newFont.Italic, newFont.Strikeout))); FCGridCell nameCell = cell.Row.getCell("PROPERTYNAME"); if (nameCell != null) { m_designerDiv.saveUndo(); String name = nameCell.Name; String value = cell.Text; int targetsSize = m_targets.Count; for (int i = 0; i < targetsSize; i++) { FCView target = m_targets[i]; m_xml.setProperty(target, name, value); if (m_collectionWindow != null) { m_collectionWindow.onPropertyChanged(name, value); } target.update(); } //恢复正确的值 String rightValue = "", type = ""; for (int i = 0; i < targetsSize; i++) { m_targets[i].getProperty(name.ToLower(), ref rightValue, ref type); } cell.Text = rightValue; Native.update(); Native.invalidate(); } } } //单击编辑框 else if (cell is FCGridButtonCell) { FCButton cButton = (cell as FCGridButtonCell).Button; if (cButton.Tag != null) { String collectionName = cButton.Tag.ToString(); int targetsSize = m_targets.Count; if (targetsSize > 0) { FCView target = m_targets[0]; CollectionWindow collectionWindow = new CollectionWindow(m_native); collectionWindow.CollectionName = collectionName; collectionWindow.DesignerDiv = m_designerDiv; collectionWindow.Target = target; collectionWindow.Xml = m_xml; collectionWindow.IsWinForm = false; collectionWindow.showDialog(); } } } } } }