DarkRoomW.frmMain.Sync C# (CSharp) Method

Sync() public method

public Sync ( ) : void
return void
        public void Sync()
        {
            this.BackColor = Properties.Settings.Default.BackgroundColor;
            this.Opacity = (float)(Properties.Settings.Default.Opacity / 100.0);
            pnlPage.BackColor = Properties.Settings.Default.PageColor;
            txtPage.BackColor = Properties.Settings.Default.PageColor;
            txtPage.Font = new Font(Properties.Settings.Default.Font.FontFamily, Properties.Settings.Default.Font.Size, txtPage.Font.Style);
            txtPage.ForeColor = Properties.Settings.Default.ForegroundColor;

            pnlNav.Visible = !(Properties.Settings.Default.HideNavigation);
            pnlNav.BackColor = Properties.Settings.Default.PageColor;
            btnPageUp.ForeColor = Properties.Settings.Default.ForegroundColor;
            btnLineUp.ForeColor = Properties.Settings.Default.ForegroundColor;
            btnLineDown.ForeColor = Properties.Settings.Default.ForegroundColor;
            btnPageDown.ForeColor = Properties.Settings.Default.ForegroundColor;

            txtPage.TabsToSpaces = Properties.Settings.Default.TabToSpaces;
            txtPage.AutoIndent = Properties.Settings.Default.AutoIndent;

            if (Properties.Settings.Default.MultipleMonitors)
            {
                HandleAdditionalScreens((this.WindowState == FormWindowState.Normal) ? 0 : 1);
            }
        }

Usage Example

Esempio n. 1
0
 private void btnFontColor_Click(object sender, EventArgs e)
 {
     clrPicker.Color = btnFontColor.BackColor;
     if (clrPicker.ShowDialog() != DialogResult.Cancel)
     {
         Properties.Settings.Default.ForegroundColor = clrPicker.Color;
         Properties.Settings.Default.Save();
         btnFontColor.BackColor = clrPicker.Color;
         parent.Sync();
     }
 }