Exemplo n.º 1
0
        private void OnPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            // Need to get the latest theme
            _colorDetails.Reset();

            // Update each control with latest color
            foreach (Control c in _controls.Keys)
            {
                Office2003Color color = (Office2003Color)_controls[c];

                switch (color)
                {
                case Office2003Color.Base:
                    c.BackColor = _colorDetails.BaseColor;
                    break;

                case Office2003Color.Light:
                    c.BackColor = _colorDetails.BaseColor1;
                    break;

                case Office2003Color.Dark:
                    c.BackColor = _colorDetails.BaseColor2;
                    break;

                case Office2003Color.Enhanced:
                    c.BackColor = _colorDetails.TrackLightColor2;
                    break;
                }
            }
        }
Exemplo n.º 2
0
        private void OnPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
        {
            // Are we using the default menu or a user defined value?
            if (_defaultFont)
            {
                base.Font = new Font(SystemInformation.MenuFont, FontStyle.Regular);
                ResizeControl();
                Recalculate();
            }

            // Reset for the latest theme
            _colorDetails.Reset();
            DefineBackColor(base.BackColor);
            Invalidate();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Process a change in system colors.
 /// </summary>
 /// <param name="e">An EventArgs structure containing the event data.</param>
 protected override void OnSystemColorsChanged(EventArgs e)
 {
     _colorDetails.Reset();
     base.OnSystemColorsChanged(e);
 }