http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/
1 class WaterMarkToolTip : ToolTip
2 {
3 public WaterMarkToolTip()
4 {
5 this.OwnerDraw = true;
6 this.Draw += new DrawToolTipEventHandler(OnDraw);
7
8 }
9
10 public WaterMarkToolTip(System.ComponentModel.IContainer Cont)
11 {
12 this.OwnerDraw = true;
13 this.Draw += new DrawToolTipEventHandler(OnDraw);
14 }
15
16 private void OnDraw(object sender, DrawToolTipEventArgs e)
17 {
18 DrawToolTipEventArgs newArgs = new DrawToolTipEventArgs(e.Graphics,
19 e.AssociatedWindow, e.AssociatedControl, e.Bounds, e.ToolTipText,
20 this.BackColor, this.ForeColor, new Font("Arial Unicode MS", 8.25f, FontStyle.Bold));
21 newArgs.DrawBackground();
22 newArgs.DrawBorder();
23 newArgs.DrawText(TextFormatFlags.TextBoxControl);
24 }
25
26
27 }
No comments:
Post a Comment