Вопрос

I have a pictureBox inside a Winforms DataRepeater for which I want to set the tooltip, I tried

ToolTip tt = new ToolTip();
tt.SetToolTip(dataRepeater1.ItemTemplate.Controls["picDeleteEntry"]
                                                       ,"Delete This Entry");

I also tried

tt.SetToolTip(picDeleteEntry, "Delete This Entry");

still its not showing tooltip.

How to solve?

Это было полезно?

Решение

Finally I arrived at a solution, but let me know if any still better solution is available

my idea is like this:

in mouseHover event of the PictureBox inside DataRepeater, set the tooltip like this

if (tt.GetToolTip((PictureBox)sender)==string.Empty)
    tt.SetToolTip((PictureBox)sender, "Delete This Entry");
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top