Provide wrap label state storage.
Inheritance: Storage
        /// <summary>
        /// Initialize a new instance of the KryptonWrapLabel class.
        /// </summary>
        public KryptonWrapLabel()
        {
            // We use double buffering to reduce drawing flicker
            SetStyle(ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.UserPaint, true);

            // We need to repaint entire control whenever resized
            SetStyle(ControlStyles.ResizeRedraw, true);

            // Yes, we want to be drawn double buffered by default
            DoubleBuffered = true;

            // Create the state storgage
            _stateCommon   = new PaletteWrapLabel(this);
            _stateNormal   = new PaletteWrapLabel(this);
            _stateDisabled = new PaletteWrapLabel(this);

            // Set the palette to the defaults as specified by the manager
            _localPalette = null;
            SetPalette(KryptonManager.CurrentGlobalPalette);
            _paletteMode = PaletteMode.Global;
            AttachGlobalEvents();

            // Create constant target for resolving palette delegates
            _redirector = CreateRedirector();

            // Default properties
            SetLabelStyle(LabelStyle.NormalControl);
            AutoSize = true;
            TabStop  = false;
        }
Beispiel #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonWrapLabel class.
        /// </summary>
        public KryptonWrapLabel()
        {
            // We use double buffering to reduce drawing flicker
            SetStyle(ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.UserPaint, true);

            // We need to repaint entire control whenever resized
            SetStyle(ControlStyles.ResizeRedraw, true);

            // Yes, we want to be drawn double buffered by default
            DoubleBuffered = true;

            // Create the state storgage
            _stateCommon = new PaletteWrapLabel(this);
            _stateNormal = new PaletteWrapLabel(this);
            _stateDisabled = new PaletteWrapLabel(this);

            // Set the palette to the defaults as specified by the manager
            _localPalette = null;
            SetPalette(KryptonManager.CurrentGlobalPalette);
            _paletteMode = PaletteMode.Global;
            AttachGlobalEvents();

            // Create constant target for resolving palette delegates
            _redirector = CreateRedirector();

            // Default properties
            SetLabelStyle(LabelStyle.NormalControl);
            AutoSize = true;
            TabStop = false;
        }