Beispiel #1
0
        /// <summary>
        /// Initializes the button for the first time
        /// </summary>
        private void Initialize()
        {
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.ResizeRedraw, true);

            Visible   = true;
            small     = false;
            collapsed = false;
            showImage = true;
            renderer  = new NaviButtonRendererOff7();
        }
Beispiel #2
0
        /// <summary>
        /// Overloaded. Raises the OnLayoutStyleChanged event
        /// </summary>
        /// <param name="e">Additional event info</param>
        protected override void OnLayoutStyleChanged(EventArgs e)
        {
            base.OnLayoutStyleChanged(e);
            switch (LayoutStyle)
            {
            case NaviLayoutStyle.Office2003Blue:
                renderer = new NaviButtonRendererOff3();
                ((NaviButtonRendererOff3)renderer).ColorTable = new NaviColorTableOff3();
                break;

            case NaviLayoutStyle.Office2003Green:
                renderer = new NaviButtonRendererOff3();
                ((NaviButtonRendererOff3)renderer).ColorTable = new NaviColorTableOff3Green();
                break;

            case NaviLayoutStyle.Office2003Silver:
                renderer = new NaviButtonRendererOff3();
                ((NaviButtonRendererOff3)renderer).ColorTable = new NaviColorTableOff3Silver();
                break;

            case NaviLayoutStyle.Office2007Blue:
                renderer = new NaviButtonRendererOff7();
                ((NaviButtonRendererOff7)renderer).ColorTable = new NaviColorTableOff7();
                break;

            case NaviLayoutStyle.Office2007Black:
                renderer = new NaviButtonRendererOff7();
                ((NaviButtonRendererOff7)renderer).ColorTable = new NaviColorTableOff7Black();
                break;

            case NaviLayoutStyle.Office2007Silver:
                renderer = new NaviButtonRendererOff7();
                ((NaviButtonRendererOff7)renderer).ColorTable = new NaviColorTableOff7Silver();
                break;
                //case NaviLayoutStyle.Office2010:
                //   renderer = new NaviButtonRendererOff10();
                //   break;
            }
            Invalidate();
        }