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

CalcGdiPlusPreferredWidth() 보호된 메소드

Calculates the preferred width of the TaskItem using GDI+
protected CalcGdiPlusPreferredWidth ( Graphics g ) : int
g System.Drawing.Graphics The Graphics used to measure the TaskItem
리턴 int
        protected int CalcGdiPlusPreferredWidth(Graphics g)
        {
            SizeF size = g.MeasureString(this.Text, this.Font, new SizeF(0, 0), this.StringFormat);

            int width = (int) Math.Ceiling(size.Width) + 18 + this.Padding.Left + this.Padding.Right;

            return width;
        }