我正在尝试将工具提示应用于工具条按钮,但它一直给我这个错误:
Operator '==' cannot be applied to operands of type 'System.Windows.Forms.Control' and 'System.Windows.Forms.ToolStripButton'
关于如何解决这个问题的任何线索?
更新:
private void toolTip1_Popup(object sender, PopupEventArgs e)
{
if (e.AssociatedControl == tBtn1)
{
using (Font f = new Font("Tahoma", 9))
{
e.ToolTipSize = TextRenderer.MeasureText(
toolTip1.GetToolTip(e.AssociatedControl), f);
}
}
}