473,397 Members | 2,099 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,397 software developers and data experts.

Tool tips

I want to show a bit of data on a form as a tool tip text,
to avoid cluttering up the form. I am using SetToolTip
for a text box.

tipNotesMoved.SetToolTip(ShowPatient.txtNotesTrack ing,
strNotesMoved)

I want the data to change from patient to patient, and
according to MSDN, SetToolTip will allow this. To quote
MSDN:
Calling the SetToolTip method more than once
for a given control does not specify multiple ToolTip text
to display for a control but instead changes the current
ToolTip text for the control.

But what actually happens is that it shows correctly for
the first patient but then adds another tooltip for the
second. The data for the first patient pops up followed
by the data for the second patient.

Does anyone know how to clear a tool tip? I have used the
RemoveAll method but it does nothing. You still get
multiple tips appearing.

Thanks,
Helen

Nov 21 '05 #1
13 1623
Helen,

"Helen Trim" <he**************@porthosp.nhs.uk> schrieb:
I want to show a bit of data on a form as a tool tip text,
to avoid cluttering up the form. I am using SetToolTip
for a text box.

tipNotesMoved.SetToolTip(ShowPatient.txtNotesTrack ing,
strNotesMoved)

I want the data to change from patient to patient, and
according to MSDN, SetToolTip will allow this. To quote
MSDN:
Calling the SetToolTip method more than once
for a given control does not specify multiple ToolTip text
to display for a control but instead changes the current
ToolTip text for the control.

But what actually happens is that it shows correctly for
the first patient but then adds another tooltip for the
second. The data for the first patient pops up followed
by the data for the second patient.
I am not able to reproduce this behavior (.NET 1.1 SP1, Windows XP
Professional SP2).
Does anyone know how to clear a tool tip? I have used the
RemoveAll method but it does nothing. You still get
multiple tips appearing.


You can remove a control's tooltip by setting it to an empty string:

\\\
Me.ToolTip1.SetToolTip(Me.TextBox1, "")
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2

Thanks, but I had already tried that. Whatever I do, it
still adds more tooltips and won't clear them.

Oh well, back to the drawing board.

Thanks,
Helen

Nov 21 '05 #3
Helen,

"Helen Trim" <an*******@discussions.microsoft.com> schrieb:
Thanks, but I had already tried that. Whatever I do, it
still adds more tooltips and won't clear them.


What Windows/.NET version are you using?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4
What Windows/.NET version are you using?


Windows 2000 & Windows 2003 ( both give same effect )
and .NET 1.1

Any ideas?

Helen

Nov 21 '05 #5
What Windows/.NET version are you using?


Windows 2000 & Windows 2003 ( both give same effect )
and .NET 1.1

Any ideas?

Helen

Nov 21 '05 #6
What Windows/.NET version are you using?


Windows 2000 & Windows 2003 ( both give same effect )
and .NET 1.1

Any ideas?

Helen

Nov 21 '05 #7
Helen,

"Helen Trim" <an*******@discussions.microsoft.com> schrieb:
What Windows/.NET version are you using?


Windows 2000 & Windows 2003 ( both give same effect )
and .NET 1.1

Any ideas?


I feel sorry, I don't have any other ideas.

What you can do is trying to build a short but complete program that can be
used to reproduce the problem, upload it somewhere in a ZIP file and post a
link to it here. This would allow others to check if they can repro the
problem. I am curious if you are able reproduce the problem in a new
project with only a button control, a tooltip component and the code that is
necessary to change the tooltip's text.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #8
Helen,

I find this a good idea from Herfried, however the best thing is to show
that sample project he tells about.

Than it is probably not even needed to make a zip file. When there is not so
much code than is only pasting in the added code (first in a notebook and
than back in the message) probably enough.

Just my thoughts,

Cor
Nov 21 '05 #9
Hello Cor and Herfried

Thanks for your help. You can recreate the problem by
starting a new windows application and adding a textbox,
label and button. Add this code to the button's click
event. Run it and type different things into the text box
and click the button. The label shows the tooltips
building up ona after the other.

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim tipButton As New System.Windows.Forms.ToolTip

tipButton.RemoveAll()
tipButton.SetToolTip(Me.Label1, "")
tipButton.SetToolTip(Me.Label1, TextBox1.Text)

End Sub

Can you think of a way to solve this?

Thanks,
Helen
Nov 21 '05 #10
Hi Helen

The problem is that each time you enter the click event you create a new
tooltip. You then remove all from this new tooltip, which has no effect on
the tooltip you created the last time you entered the event. I would either
make it static and only create a new one if it is Nothing, or move the
declaration to module level.

HTH

Charles
"Helen Trim" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
Hello Cor and Herfried

Thanks for your help. You can recreate the problem by
starting a new windows application and adding a textbox,
label and button. Add this code to the button's click
event. Run it and type different things into the text box
and click the button. The label shows the tooltips
building up ona after the other.

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim tipButton As New System.Windows.Forms.ToolTip

tipButton.RemoveAll()
tipButton.SetToolTip(Me.Label1, "")
tipButton.SetToolTip(Me.Label1, TextBox1.Text)

End Sub

Can you think of a way to solve this?

Thanks,
Helen

Nov 21 '05 #11

So simple! Thanks, it works now.

Helen
-----Original Message-----
Hi Helen

The problem is that each time you enter the click event you create a newtooltip. You then remove all from this new tooltip, which has no effect onthe tooltip you created the last time you entered the event. I would eithermake it static and only create a new one if it is Nothing, or move thedeclaration to module level.

HTH

Charles
"Helen Trim" <an*******@discussions.microsoft.com> wrote in messagenews:07****************************@phx.gbl...
Hello Cor and Herfried

Thanks for your help. You can recreate the problem by
starting a new windows application and adding a textbox,
label and button. Add this code to the button's click
event. Run it and type different things into the text box and click the button. The label shows the tooltips
building up ona after the other.

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim tipButton As New System.Windows.Forms.ToolTip

tipButton.RemoveAll()
tipButton.SetToolTip(Me.Label1, "")
tipButton.SetToolTip(Me.Label1, TextBox1.Text)

End Sub

Can you think of a way to solve this?

Thanks,
Helen

.

Nov 21 '05 #12
Charles,

Your solution is right, however your explanation in my opinion not complete
(I tried it).

I have the idea that with *settooltip* every time there is an *add* of a
tooltipobject too a collection of tooltips and not *set* a reference to a
tooltip.

When showed it shows a video of all tooltips.

However I nowhere saw a *removetooltip*

Where the instruction should be *addTooltip* when what I saw is right.

Interesting.

:-)

Cor
Nov 21 '05 #13
Helen,

"Helen Trim" <an*******@discussions.microsoft.com> schrieb:
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim tipButton As New System.Windows.Forms.ToolTip

tipButton.RemoveAll()
tipButton.SetToolTip(Me.Label1, "")
tipButton.SetToolTip(Me.Label1, TextBox1.Text)

End Sub

Can you think of a way to solve this?


Instead of creating a new instance of 'ToolTip' every time the button is
clicked, use always the /same/ instance. If you are using VS.NET, simply
place a tooltip component on your form at design time and use this component
throughout your code. Notice that it's not necessary to remove the tooltip
before setting it to a new text if you are using the same tooltip object.
The code

\\\
ToolTip1.SetToolTip(Me.Label1, TextBox1.Text)
///

should be sufficient.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #14

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

Similar topics

8
by: gregory_may | last post by:
Is there a way to grab a "Screen Shot" that includes "Tool Tips"? I saw this code someplace, cant remember where. But it doesnt grab "Tool Tips". Is there a better way to do this in .net?...
34
by: Steve Horrillo | last post by:
Anyone know where to get a Tool Tips javascript that will pop up a little box when hovered for words that needs more explanation. I'm using Front Page BTW. -- Warmest regards, Steve...
5
by: RBriggs416 | last post by:
In an attempt to clean up my form I went to TOOLS STARTUP and removed check marks from the following: Allow full menus Allow default shortcut menus Allow built in toolbars Allow toolbar/menu...
1
by: Salad | last post by:
Win XP. A97. Anyone know why my tool tips don't display when the mouse is held over the field? If I reboot the computer the tool tips will display. A couple of days will pass and I'll check...
10
by: Mandy | last post by:
I have a command line tool that I would like to run from my .NET web application using System.Diagnostics.ProcessStartInfo. I run cmd.exe with this and then pass the command to run the tool as an...
2
by: trbjr | last post by:
Hello experts! I hope someone can tell me where I can find working javascript code that creates and enables tool tips. I have O'Reilly's JavaScript, The Definitive Guide and have been studying...
2
by: Nagabhushan16 | last post by:
Hi friends, I am working on enhancing a tool...which helps in modifying some control files..in production enveronment.. 1) Whenever a person want to change the control files he will login the...
2
by: taylorkand | last post by:
I am working on a map display which is linked to a database containing information on our trucks. I.E. Lat/Long, Customer, Truck number, Product, etc... I have a form with mappoint control and...
1
by: Brian | last post by:
How can I create tool tips for Richtextboxes.... this is what I am trying to do.... have a one line rich text box. When the users hovers over it, the tool tip will display all the text in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.