代码之家  ›  专栏  ›  技术社区  ›  Kashif

使用工具提示类在网格列(winforms)上添加工具提示,是否可能?

  •  2
  • Kashif  · 技术社区  · 15 年前

    我想在WinForms中的网格列上使用工具提示类添加工具提示。

    我想要这个,因为我需要在radgridview中延长内置网格工具提示的持续时间。如果你能帮助我设置网格内置工具提示的时间,那么它也就足够了。

    编辑:有人能告诉我这有没有可能?

    谢谢。

    1 回复  |  直到 15 年前
        1
  •  3
  •   Zach Johnson    15 年前

    可以向现有控件添加工具提示。我从来没有用过radgridview,所以我只能给你一个大致的方向。

    ToolTip tooltip = new ToolTip();
    tooltip.SetToolTip(grid, "your caption here");
    tooltip.Popup += HandleToolTipPopup;
    tooltip.AutoPopDelay = {time to display tooltip};
    
    private void HandleToolTipPopup(object sender, PopupEventArgs e)
    {
        Point mouseLocation = Control.MousePosition;
        Point relativeLocation = grid.PointToClient(mouseLocation);
    
        // Check to see if it is within the area to popup on.
        // Set e.Cancel to false if not.
    }