Problem with tooltip
-
Hi all, I've created a simple windows application in C# and added a button to the form and associated a tooltip to the button.The problem is the tooltip is not showing up if i click on the button.(i.e)the tooltip is getting displayed properly n number of times before i click on the button, but it doesnt show up after i click on it.. :sigh: wat could be the problem here??any help will be highly appreciated :-D thanks and regards, raj
-
Hi all, I've created a simple windows application in C# and added a button to the form and associated a tooltip to the button.The problem is the tooltip is not showing up if i click on the button.(i.e)the tooltip is getting displayed properly n number of times before i click on the button, but it doesnt show up after i click on it.. :sigh: wat could be the problem here??any help will be highly appreciated :-D thanks and regards, raj
-
Hi all, I've created a simple windows application in C# and added a button to the form and associated a tooltip to the button.The problem is the tooltip is not showing up if i click on the button.(i.e)the tooltip is getting displayed properly n number of times before i click on the button, but it doesnt show up after i click on it.. :sigh: wat could be the problem here??any help will be highly appreciated :-D thanks and regards, raj
Hi raj, My suggestion is you may add a mouse hover event on that button.When move over the button then fire event to show up what you want to display. example,
public ToolTip tooltip=new ToolTip(); public Form1() { InitializeComponent(); button1.MouseHover += new EventHandler(showTooltips); } private void showTooltips(object sender, EventArgs e) { tooltip.ShowAlways = true; // Set up the ToolTip text for the Button . tooltip.SetToolTip((Button)sender, "50"); }
from the example, when you click on button,it will display '50' Hope this help you. regard cocoonmodified on Wednesday, April 16, 2008 4:40 AM
-
Hi raj, My suggestion is you may add a mouse hover event on that button.When move over the button then fire event to show up what you want to display. example,
public ToolTip tooltip=new ToolTip(); public Form1() { InitializeComponent(); button1.MouseHover += new EventHandler(showTooltips); } private void showTooltips(object sender, EventArgs e) { tooltip.ShowAlways = true; // Set up the ToolTip text for the Button . tooltip.SetToolTip((Button)sender, "50"); }
from the example, when you click on button,it will display '50' Hope this help you. regard cocoonmodified on Wednesday, April 16, 2008 4:40 AM
-
well i dont want the tooltip to be displayed on click of the button.It should get displayed when the mouse pointer is idle over it for some time.
His code does just that.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
-
well i dont want the tooltip to be displayed on click of the button.It should get displayed when the mouse pointer is idle over it for some time.