示例#1
0
        /// <summary>Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.</summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data. </param>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            DarkPainting.DrawText(e.Graphics, this.text ?? this.EmptyText, new Rectangle(this.DisplayRectangle.X + 1, this.DisplayRectangle.Y, this.DisplayRectangle.Width - 5, this.DisplayRectangle.Height), this.text == null ? DarkPainting.ForegroundInactive : DarkPainting.Foreground, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
        }
示例#2
0
        /// <summary>Raises the <see cref="E:System.Windows.Forms.Control.Paint" /> event.</summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data. </param>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            DarkPainting.DrawText(e.Graphics, this.Text, this.DisplayRectangle);
        }