473,385 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Tooltip on a label widget?


Hi all -

I'm trying to put a tooltip on a label in csharp... I found an example
that says to add some code to the InitializeComponent() method, but that's
in the .Designer.cs file - which says to not edit it.

Is there a different way to go about it that is designer friendly?

....in InitializeComponent():

this.labelsToolTip = new System.Windows.Forms.ToolTip(new
System.ComponentModel.Container());

....in form:

this.labelsToolTip.SetToolTip(label1, "First Label");

Thanks!
Dec 18 '06 #1
1 3444
I don't understand your problem here.
Tooltips can be placed on any Control ased object. In fact the only thing it
excludes is another tooltip.

Tooltips can be placed on labels at design time with no problem.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Alex" <me******@test.comwrote in message
news:Xn*****************************@199.45.49.11. ..
>
Hi all -

I'm trying to put a tooltip on a label in csharp... I found an example
that says to add some code to the InitializeComponent() method, but that's
in the .Designer.cs file - which says to not edit it.

Is there a different way to go about it that is designer friendly?

...in InitializeComponent():

this.labelsToolTip = new System.Windows.Forms.ToolTip(new
System.ComponentModel.Container());

...in form:

this.labelsToolTip.SetToolTip(label1, "First Label");

Thanks!


Dec 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephen | last post by:
Is it possible to add a tooltip in the column of a Datagrid. Can someone please show me how I would do this for the datagrid column below. Thanks for any help anyone can give me. Here is the...
6
by: Robert | last post by:
Hello. I have been trying out the Lebans ToolTip Classes at http://www.lebans.com/tooltip.htm, to display "balloon" style help tips in a form. The classes I am using are located at...
0
by: Sam Sungshik Kong | last post by:
Hello! I have a form with a button, a label, a toolTip and a notifyIcon. I set the "ToolTip on toolTip1" of the label. For the button click: private void button1_Click(object sender,...
4
by: Henry Padilla | last post by:
I am making a UserControl that is entirely taken up by Labels. I have found a way to pass the Click even to the outside (I have the same handler for each label.click and that raises a...
3
by: Craig G | last post by:
what way do you code it? i tried the following but it wouldnt display it lblAdd_info is a hidden field in the cell itself that contains the data i want to display in the tooltip text. i added the...
3
by: Dustan | last post by:
I have a Button object that gets replaced by a Label when clicked. Button(buttonsframe,text=' ',command=c,font=buttonsFont) Note that the text is a single space. buttonsFont uses 'Courier New' as...
2
by: puja | last post by:
hi all, i have a grid view where am displaying data from dataset. My dataset consists of columns Customer name, surname, date requested, sales person, file number , status and comments I am...
4
by: rn5a | last post by:
A DataList displays 3 columns - Product, Category & Price. These columns are populated with records from a SQL Server 2005 DB table. Apart from the above 3 DB columns that the resultset retrieves,...
7
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.