winform datagridview 自定义tooltip


代码如下:

 

1 private void toolTip1_Draw(object sender, DrawToolTipEventArgs e)
2         {
3            e.Graphics.DrawEllipse(Pens.Red, e.Bounds);
4             
5             e.Graphics.FillRectangle(Brushes.Blue, e.Bounds);
6        // e.Graphics.DrawRectangle(Pens.Chocolate, new Rectangle(0, 0, e.Bounds.Width - 1, e.Bounds.Height - 1));
7         e.Graphics.DrawString(this.toolTip1.ToolTipTitle + e.ToolTipText, e.Font, Brushes.Red, e.Bounds);
8     
9         }

相关文章: