代码如下:
View Code
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 }
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 }
注意,为了显示上述的这种效果,必须设置OwnerDraw的值为true;并且isballoon的值为false。