private void ColourButtonClicked(object sender, EventArgs e) { Button button = (Button)sender; if (this.m_AppearanceDialogPage.ColourTheme != ColourTheme.Custom) { if (MessageBox.Show("Switch to custom colour theme using these colours?", "Colour Theme", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } ColourSettings colour_settings = this.m_AppearanceDialogPage.Colours; this.m_AppearanceDialogPage.BackColour = colour_settings.m_BackColour; this.m_AppearanceDialogPage.ForeColour = colour_settings.m_ForeColour; this.m_AppearanceDialogPage.ControlColour = colour_settings.m_ControlColour; this.m_AppearanceDialogPage.SelectColour = colour_settings.m_SelectColour; this.m_AppearanceDialogPage.HighlightColour = colour_settings.m_HighlightColour; this.m_AppearanceDialogPage.HighlightTextColour = colour_settings.m_HighlightTextColour; this.m_AppearanceDialogPage.SelectedHighlightTextColour = colour_settings.m_SelectedHighlightTextColour; this.m_AppearanceDialogPage.CodeColour = colour_settings.m_CodeColour; this.m_AppearanceDialogPage.CodeFilenameColour = colour_settings.m_CodeFilenameColour; this.m_AppearanceDialogPage.ColourTheme = ColourTheme.Custom; this.UpdateColourThemeComboBox(); } this.m_ColourDialog.Color = button.BackColor; this.m_ColourDialog.ShowDialog(this); button.BackColor = this.m_ColourDialog.Color; this.UpdateColoursFromButtons(); }
private void UpdateButtonColours() { ColourSettings colour_settings = this.m_AppearanceDialogPage.Colours; this.m_BackColourButton.BackColor = colour_settings.m_BackColour; this.m_ForeColourButton.BackColor = colour_settings.m_ForeColour; this.m_ControlColourButton.BackColor = colour_settings.m_ControlColour; this.m_SelectColourButton.BackColor = colour_settings.m_SelectColour; this.m_HighlightColourButton.BackColor = colour_settings.m_HighlightColour; this.m_HighlightTextColourButton.BackColor = colour_settings.m_HighlightTextColour; this.m_SelectedHighlightTextColourButton.BackColor = colour_settings.m_SelectedHighlightTextColour; this.m_CodeColourButton.BackColor = colour_settings.m_CodeColour; this.m_CodeFilenameColourButton.BackColor = colour_settings.m_CodeFilenameColour; }