ZForge.Controls.ExplorerBar.TaskItem.CalcGdiPlusPreferredHeight C# (CSharp) 메소드

CalcGdiPlusPreferredHeight() 보호된 메소드

Calculates the preferred height of the TaskItem using GDI+
protected CalcGdiPlusPreferredHeight ( Graphics g ) : int
g System.Drawing.Graphics The Graphics used to measure the TaskItem
리턴 int
        protected int CalcGdiPlusPreferredHeight(Graphics g)
        {
            //
            int width = this.Width - this.Padding.Right;

            if (this.Image != null)
            {
                width -= 16 + this.Padding.Left;
            }

            //
            SizeF size = g.MeasureString(this.Text, this.Font, width, this.StringFormat);

            //
            int height = (int) Math.Ceiling(size.Height);

            return height;
        }