WinForm中使用自定义Tooltip控件

  • private ToolTip tooltipCtr;
  • 构造函数中:
    • 隐藏默认的Tooltip:this.ShowCellToolTips = false;
    • this.tooltipCtr = new ToolTip();
    • 设置停留时间(还有许多其他时间设置):this.tooltipCtr.AutoPopDelay = 1000 * 60;
    • 在CellMouseEnterHandler等事件中设置数据,在鼠标处设置文本:tooltipCtr.Show(HttpUtility.HtmlDecode(((BasicData)this.Rows[rowIndex].DataBoundItem).VarDescLong), this, PointToClient(MousePosition));
    • 宽度?自动换行?

猜你喜欢

转载自www.cnblogs.com/wyp1988/p/9896967.html