Hi,
I wanted to change the font of the ToolTip control. So I set the OwnerDraw in the control to "true" and created the Popup and Draw routines:
And added the appropriate lines in the Designer:
When I hover over the Label, the Popup event fires, but the Draw does not. Any ideas?
I wanted to change the font of the ToolTip control. So I set the OwnerDraw in the control to "true" and created the Popup and Draw routines:
C#:
private void ttControl_Draw(object sender, DrawToolTipEventArgs e)
{
Font tooltipFont = new Font("Tahoma", 15.0f, FontStyle.Bold);
e.DrawBackground();
e.DrawBorder();
e.Graphics.DrawString(e.ToolTipText, tooltipFont, Brushes.Black, new PointF(2, 2));
}
private void ttControl_Popup(object sender, PopupEventArgs e)
{
Size newSize;
newSize = new Size(TextRenderer.MeasureText(ttControl.GetToolTip(e.AssociatedControl), new Font("Tahoma", 15.0f, FontStyle.Bold)).Width,e.ToolTipSize.Height);
e.ToolTipSize = newSize;
}
And added the appropriate lines in the Designer:
C#:
this.ttControl.Draw += new System.Windows.Forms.DrawToolTipEventHandler(this.ttControl_Draw);
this.ttControl.Popup += new System.Windows.Forms.PopupEventHandler(this.ttControl_Popup);
When I hover over the Label, the Popup event fires, but the Draw does not. Any ideas?