Ejemplo n.º 1
0
        void DrawLink(CustomDrawCellEventArgs e, GraphicsCache cache, string text)
        {
            e.DrawDefault();
            e.Handled = true;
            var        brush      = cache.GetSolidBrush(Color.FromArgb(5, 111, 206));
            var        font       = cache.GetFont(e.Font, FontStyle.Underline);
            SizeF      size       = cache.CalcTextSize(text, font, StringFormat.GenericDefault, 0);
            float      height     = (float)e.Bounds.Height - size.Height;
            RectangleF textBounds = new RectangleF(e.Bounds.Left + 8, e.Bounds.Top + height / 2, size.Width + 4, size.Height);

            cache.DrawString(text, font, brush, Rectangle.Round(textBounds), StringFormat.GenericDefault);
        }