473,889 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 InitializeCompo nent() 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 InitializeCompo nent():

this.labelsTool Tip = new System.Windows. Forms.ToolTip(n ew
System.Componen tModel.Containe r());

....in form:

this.labelsTool Tip.SetToolTip( label1, "First Label");

Thanks!
Dec 18 '06 #1
1 3463
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.4 9.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 InitializeCompo nent() 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 InitializeCompo nent():

this.labelsTool Tip = new System.Windows. Forms.ToolTip(n ew
System.Componen tModel.Containe r());

...in form:

this.labelsTool Tip.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
2994
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 datagrid coloum which I want to put the tooltip when the user hovers over it. <asp:BoundColumn DataField="ID" SortExpression="ID" HeaderText="ID"> <HeaderStyle ForeColor="White" CssClass="dgHeader"> </HeaderStyle>
6
2708
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 http://www.lebans.com/DownloadFiles/A2kTooltip.zip So far the classes work perfectly, except that now I need to extend it to support other controls besides the ones given in the example form. I have gotten it to work with some controls, but not others. I...
0
1593
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, EventArgs e) { this.ShowInTaskbar = false;
4
10083
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 this.OnClick(e); ) How do I do this with whatever mystery is the ToolTip component? Since the UserControl surface is not exposed, it will never send the ToolTip whatever it needs to fire. I've tried the OnMouseHover() I've tried looking for the ToolTip...
3
2554
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 following into the ItemDatabound event for the grif but it wont display If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.Item Then
3
1857
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 a family. When clicked, the Button is destroyed and replaced with a Label object: Label(buttonsframe,text=x,font=buttonsFont,relief=RAISED) The intent is for the Label object to look identical to the button
2
9458
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 displaying all columns in grid view except comments. Now I want to have comments displayed (for each row) as tooltip when u hover over particular row.
4
7814
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, there is another DB column named 'Description'. Though the resultset fetches this column as well along with the above 3 columns, I am excluding the Description column from the DataList - the reason being most of the descriptions are pretty long &...
7
6771
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 my code and tell me how to fix it. Thanks The Mad Ape
0
9966
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9810
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10791
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10442
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5830
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6029
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4647
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3256
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.