views:

349

answers:

1

I want to add a tooltip using ToolTip class on a column of a grid in winforms.

I want this because I need to extend duration of builtin grid tooltip in radgridview. If you can help me in settings the time of builtin tooltip of grid then it would also be sufficient.

EDIT: Can anybody just tell me that is it possible or not?

Thanks.

+2  A: 

It's possible to add a ToolTip to an existing control. I've never used radgridview, so I can only give you a general direction to head.

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.
}
Zach Johnson
Thanks for your answer.
Muhammad Kashif Nadeem