Pergunta

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?

Foi útil?

Solução

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");
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top