Can anybody guide me how to use tooltip on listbox
tooltip on listbox
Collapse
X
-
Originally posted by PlaterDid you add a tooltip object to your form?
I hav used this code
private void lstRecommendedT est_MouseHover( object sender, EventArgs e)
{
ToolTip tp = new ToolTip();
tp.Show("hi", lstRecommendati ons, x, y, 1130);
}
private void lstRecommendedT est_MouseMove(o bject sender, MouseEventArgs e)
{
x = e.X;
y = e.Y;
}Comment
-
It would be nice if you did any work for yourself.
On your toolbar in designer mode you should be able to drag and drop a tooltip object onto your form.
you can then add tooltip text to any of the controls on your form.
MSDN ToolTip if need be.Comment
-
Drop a "ToolTip" component on to your form, view the properties of your ListBox control, and all of the Tool Tip properties are accessible. To set the message at RunTime: Me.ListBox1.Too lTip1.Text = (Whatever you want your Tool Tip to display when the user mouses over the control)
KKComment
-
private void lstRecommendedT est_MouseHover( object sender, EventArgs e)
{
tp.Show(lstReco mmendedTest.Sel ectedItem.ToStr ing(), lstRecommendedT est, x, y, 1300);
this.toolTip1.S how(@@@@@Here I want to show the listbox item on which the mouse is hovered@@@@@, x, y, 1300);)
}
private void lstRecommendedT est_MouseMove(o bject sender, MouseEventArgs e)
{
x = e.X;
y = e.Y;
}
The problem is dat I dont know hw to show the listbox item which is hovered in the tool tipComment
-
Originally posted by amitjauraprivate void lstRecommendedT est_MouseHover( object sender, EventArgs e)
{
tp.Show(lstReco mmendedTest.Sel ectedItem.ToStr ing(), lstRecommendedT est, x, y, 1300);
this.toolTip1.S how(@@@@@Here I want to show the listbox item on which the mouse is hovered@@@@@, x, y, 1300);)
}
private void lstRecommendedT est_MouseMove(o bject sender, MouseEventArgs e)
{
x = e.X;
y = e.Y;
}
The problem is dat I dont know hw to show the listbox item which is hovered in the tool tip
i dont think that you can do that, by just hover, when the user clicks on an item you can code it to show in the tooltip?Comment
-
If you want a message to change on hover, I recomend just changing some label text near your listbox control. That way it can be changed imediately on mouse over, instead of trying to figure out the pause/wait time to show a popup tooltip and then closing it again.Comment
Comment