1. 程式人生 > >WinForm中使用自定義Tooltip控制元件

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));
    • 寬度?自動換行?