Example #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="TriStateTreeView"/> class.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public TriStateTreeView()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            if (ThemeInformation.VisualStylesEnabled)
            {
                Bitmap    bmp      = new Bitmap(m_TriStateImages.ImageSize.Width, m_TriStateImages.ImageSize.Height);
                Rectangle rc       = new Rectangle(0, 0, bmp.Width, bmp.Height);
                Graphics  graphics = Graphics.FromImage(bmp);

                ThemePaint.Draw(graphics, this, ThemeClasses.Button, ThemeParts.ButtonCheckBox,
                                ThemeStates.CheckBoxCheckedDisabled, rc, rc);
                m_TriStateImages.Images[0] = bmp;

                ThemePaint.Draw(graphics, this, ThemeClasses.Button, ThemeParts.ButtonCheckBox,
                                ThemeStates.CheckBoxUncheckedNormal, rc, rc);
                m_TriStateImages.Images[1] = bmp;

                ThemePaint.Draw(graphics, this, ThemeClasses.Button, ThemeParts.ButtonCheckBox,
                                ThemeStates.CheckBoxCheckedNormal, rc, rc);
                m_TriStateImages.Images[2] = bmp;
            }

            ImageList          = m_TriStateImages;
            ImageIndex         = (int)CheckState.Unchecked;
            SelectedImageIndex = (int)CheckState.Unchecked;
        }
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     ThemePaint.Draw(e.Graphics,
                     this,
                     ThemeClasses.Tab,
                     ThemeParts.TabBody,
                     ThemeStates.TabItemNormal,
                     ClientRectangle,
                     ClientRectangle);
 }
Example #3
0
 protected override void OnPaintBackground(PaintEventArgs pevent)
 {
     base.OnPaintBackground(pevent);
     if (Application.RenderWithVisualStyles)
     {
         ThemePaint.Draw(pevent.Graphics,
                         this,
                         ThemeClasses.Tab,
                         ThemeParts.TabBody,
                         ThemeStates.TabItemNormal,
                         ClientRectangle,
                         ClientRectangle);
     }
 }