문제

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.

도움이 되었습니까?

해결책

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.
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top