ToolTip for Composite UserControl?

M

Mark Olbert

I have several composite usercontrols in my C# application. However, I cannot get tooltips to appear
for any of them. The call to SetToolTip() succeeds, but nothing shows up. I've verified that the
ToolTip component can extend the tooltip property to the composite controls in question (i.e.,
((IExtenderProvider) toolTipComponent).CanExtend returns true).

Is there a trick to getting tooltips to show up for usercontrols?

Thanx in advance for any help or advice.

- Mark
 
Y

Ying-Shen Yu[MSFT]

Hi Mark,
I'd like to know more about your composite control ? is it derived from
UserControl?
If it is, in my test code it works fine, you may try it, I just created an
user control and put a button and a text box on it, then put the
usercontrol on a form and add a tooltip component on the form. Then set
some text to the tooltip text property of that usercontrol. If you have
problem in this case, please let me know and provide some more information
on it.
if the base class is not Usercontrol, does it have a public property names
Handle and with a valid value? Tooltip need a window to surround. Maybe you
should try encapsulating the Tooltip component into your composite control
and publish a TooltipText property;
If you meet any problems on this issue, please be free to let me know.
Thanks for using MSDN Newsgroup!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
| NNTP-Posting-Date: Sun, 05 Oct 2003 12:57:31 -0500
| From: Mark Olbert <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Subject: ToolTip for Composite UserControl?
| Date: Sun, 05 Oct 2003 10:57:31 -0700
| Organization: Olbert & McHugh, Ltd.
| Reply-To: (e-mail address removed)
| Message-ID: <[email protected]>
| X-Newsreader: Forte Agent 1.93/32.576 English (American)
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Lines: 10
| X-Trace:
sv3-N8hX3cRyHvXLxfpZnaIU2FSWRNuO6Ek1NL4rFirK5oGwDQPD6X14nU9n5rnbV4JyrWg5QVt0
xLPPMso!KvMx/41jMbrqkpIIN+dmlwbu6tlfIQtCNdyeyM8iWH9I+xnpjrQvlIEhYI5C+xwgwQcV
zg==
| X-Complaints-To: (e-mail address removed)
| X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.1
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!prodigy.com!rip!news.webusenet.com!peer01.cox.net!cox.net!small1.nntp.aus1
.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!
nntp.giganews.com!news.giganews.com.POSTED!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:53768
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| I have several composite usercontrols in my C# application. However, I
cannot get tooltips to appear
| for any of them. The call to SetToolTip() succeeds, but nothing shows up.
I've verified that the
| ToolTip component can extend the tooltip property to the composite
controls in question (i.e.,
| ((IExtenderProvider) toolTipComponent).CanExtend returns true).
|
| Is there a trick to getting tooltips to show up for usercontrols?
|
| Thanx in advance for any help or advice.
|
| - Mark
|
 
M

Mark Olbert

Ying-Shen,

I'm setting the tooltip via:

theTip.SetToolTip(aCtl, tipText);

where theTip is a ToolTip object, and aCtl is whatever control I'm trying to set the tip for. This
works fine for all the MS-supplied controls. Is there another way to set tooltip text directly
against a control? There doesn't seem to be any "ToolTipText" property of the controls, which is, I
presume, because it is the ToolTip object that implements the property, via IExtenderProperty,
rather than the individual control.

To answer your other question, yes, the custom controls I'm having problems with are directly
descended from System.Windows.Forms.UserControl.

Any suggestions?

- Mark
 
M

Mark Olbert

Ying Shen,

I've done so more newsgroup research, and discovered that what's happening is a UserControl's
tooltip only appears when you hover the mouse over a part of the UserControl that doesn't have a
Windows control under it. In other words, if you hover the mouse over an embedded Windows control
only that control's tooltip text will appear, not the tooltip text for the UserControl.

There are workarounds for that, but they're relatively ugly. I think MS should treat this as a bug,
and change the tooltip behavior so that if an embedded control has no tooltip text, but the
UserControl does, the UserControl text appears.

- Mark
 
Y

Ying-Shen Yu[MSFT]

Hi Mark,
The Tooltip works in this way when being used with UserControl.
Also thanks for your suggestion. I'd recommend that you forward the
recommendation to the Microsoft Wish Program:

Microsoft offers several ways for you to send comments or suggestions about
Microsoft products. If you have suggestions for product enhancements that
you would like to see in future versions of Microsoft products, please
contact us using one of the methods listed later in this article.

Let us know how we can improve our products.

Product Enhancement suggestions can include:

o Improvements on existing products.
o Suggestions for additional features.
o Ways to make products easier to use.

All product enhancement suggestions received become the sole property of
Microsoft. Should a suggestion be implemented, Microsoft is under no
obligation to provide compensation.

World Wide Web - To send a comment or suggestion via the Web, use one of
the following methods:
o In Internet Explorer 6, click Send Feedback on the Help menu and then
click the link in the Product Suggestion section of the page that appears.
o In Windows XP, click Help and Support on the Start menu. Click Send your
feedback to Microsoft, and then fill out the Product Suggestion page that
appears.
o Visit the following Microsoft Web site:
http://www.microsoft.com/ms.htm
o Click Microsoft.com Guide in the upper-right corner of the page and then
click Contact Us . Click the link in the Product Suggestion section of the
page that appears.
o Visit the following Microsoft Product Feedback Web site
http://register.microsoft.com/mswish/suggestion.asp
and then complete and submit the form.

E-mail - To send comments or suggestions via e-mail, use the following
Microsoft Wish

Program e-mail address, (e-mail address removed).

FAX - To send comments or suggestions via FAX, use the following Microsoft
FAX number, (425) 936-7329.

NOTE Address the FAX to the attention of the Microsoft Wish Program.

US Mail - To send comments or suggestions via US Mail, use the following
Microsoft mailing address:

Microsoft Corporation
Attn. Microsoft Wish Program
One Microsoft Way
Redmond, WA 98052-6399
MORE INFORMATION

Each product suggestion is read by a member of our product feedback team,
classified for easy access, and routed to the product or service team to
drive Microsoft product and/or service improvements. Because we receive an
abundance of suggestions (over 69,000 suggestions a year!) we can't
guarantee that each request makes it into a final product or service. But
we can tell you that each suggestion has been received and is being
reviewed by the team that is most capable of addressing it.

All product or service suggestions received become the sole property of
Microsoft. Should a suggestion be implemented, Microsoft is under no
obligation to provide compensation.


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending, Thanks!

--------------------
| NNTP-Posting-Date: Mon, 06 Oct 2003 23:21:30 -0500
| From: Mark Olbert <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Subject: Re: ToolTip for Composite UserControl?
| Date: Mon, 06 Oct 2003 21:21:31 -0700
| Organization: Olbert & McHugh, Ltd.
| Reply-To: (e-mail address removed)
| Message-ID: <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| X-Newsreader: Forte Agent 1.93/32.576 English (American)
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Lines: 12
| X-Trace:
sv3-nRq89LD3NQEz9iZPgHsdbt/t+dn1RhYkMlKSJ5H/WI/KmSv3EYccAPl3OgUeFJLLXD5cpqDq
4nPXaaB!eg/umSrSQC2ouZulfaFKSgfwf2VUK5g2AxSC/uZcYy1LX6U6SqKGJyJgTxVail5TgoVJ
5A==
| X-Complaints-To: (e-mail address removed)
| X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.1
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!prodigy.com!rip!news.webusenet.com!peer01.cox.net!cox.net!border3.nntp.aus
1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!news.giganew
s.com.POSTED!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:53848
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| Ying Shen,
|
| I've done so more newsgroup research, and discovered that what's
happening is a UserControl's
| tooltip only appears when you hover the mouse over a part of the
UserControl that doesn't have a
| Windows control under it. In other words, if you hover the mouse over an
embedded Windows control
| only that control's tooltip text will appear, not the tooltip text for
the UserControl.
|
| There are workarounds for that, but they're relatively ugly. I think MS
should treat this as a bug,
| and change the tooltip behavior so that if an embedded control has no
tooltip text, but the
| UserControl does, the UserControl text appears.
|
| - Mark
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top