Hi,
I have used the ToolTipControl_Draw and ToolTipControl_Popup functions to adjust the Size and Font of tooltips on normal controls like TextEdit. Is there a way to do that for the individual cells on a DataGridView?
I have used the ToolTipControl_Draw and ToolTipControl_Popup functions to adjust the Size and Font of tooltips on normal controls like TextEdit. Is there a way to do that for the individual cells on a DataGridView?
C#:
private void ttControl_Draw(object sender, DrawToolTipEventArgs e)
{
Font tooltipFont = new Font("Microsoft Sans Serif", 24.0f, FontStyle.Bold);
e.DrawBackground();
e.DrawBorder();
e.Graphics.DrawString(e.ToolTipText, tooltipFont, Brushes.Black, new PointF(4, 2));
}
private void ttControl_Popup(object sender, PopupEventArgs e)
{
Size newSize;
newSize = TextRenderer.MeasureText(ttControl.GetToolTip(e.AssociatedControl), new Font("Microsoft Sans Serif", 24.0f, FontStyle.Bold), new Size(int.MaxValue, int.MaxValue), TextFormatFlags.NoPadding);
newSize = new Size(newSize.Width, newSize.Height + 6);
e.ToolTipSize = newSize;
}