コード例 #1
0
        private Rectangle GetTextBounds(Graphics g)
        {
            Rectangle bounds = base.Bounds;

            bounds.Inflate(-20 * base.m_scale, 0);
            if (this.m_bMultiLine)
            {
                int height = ExtendDraw.MeasureString(g, this.Text, base.Font, bounds.Width).Height;
                if (height < bounds.Height)
                {
                    bounds.Y     += (bounds.Height - height) / 2;
                    bounds.Height = height;
                }
            }
            return(bounds);
        }
コード例 #2
0
 public override void OnResize()
 {
     if (this.m_bMultiLine)
     {
         using (Graphics graphics = base.m_parent.CreateGraphics())
         {
             int num = ExtendDraw.MeasureString(graphics, this.Text, base.Font, base.Width - (40 * base.m_scale)).Height + (0x36 * base.m_scale);
             if (num > (100 * base.m_scale))
             {
                 num = 100 * base.m_scale;
             }
             base.Height = num;
             return;
         }
     }
     base.Height = 0x1b * base.m_scale;
 }