2010-02-25 100 views
2

我想在winforms的网格列上使用ToolTip类添加工具提示。使用工具提示类在网格(Winforms)的列上添加工具提示,它有可能吗?

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

编辑:任何人都可以告诉我,这可能吗?

谢谢。

+0

我不明白为什么不是(但我可能是错的),你有一些代码,你可以发布,这是不工作,你的期望? – Nate 2010-03-01 16:42:36

回答

3

可以将工具提示添加到现有的控件。我从来没有用过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. 
} 
+0

感谢您的回答。 – Kashif 2010-03-05 04:41:21