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

Tooltips only work once on form

Hi all,

Using the toolbox I added a tooltip provider to my form, and set the text
for each of my buttons using the properties window.

When I first show the form using .showdialog the tooltips work. However
if I close and re-open the form the tooltips are no longer displayed.

Am I missing something obvious or is this a bug ??

thanks in advance
Steve

Nov 21 '05 #1
11 1649
Are you using 2003 or 2003, I have no problems on 2003. Also how are you
closing and re-opening the form ?

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"Steve Cutting" <sc******@optusnet.com.au> wrote in message
news:op********************************@4ax.com...
Hi all,

Using the toolbox I added a tooltip provider to my form, and set the text
for each of my buttons using the properties window.

When I first show the form using .showdialog the tooltips work. However
if I close and re-open the form the tooltips are no longer displayed.

Am I missing something obvious or is this a bug ??

thanks in advance
Steve

Nov 21 '05 #2
On Fri, 8 Oct 2004 14:11:22 +0100, "One Handed Man \( OHM - Terry Burns \)"
<news.microsoft.com> wrote:
Are you using 2003 or 2003, I have no problems on 2003. Also how are you
closing and re-opening the form ?


Hi Terry,

Using 2003. The form is opened using .showdialog from another form.
Closing via dialogresult.OK/cancel or close button. Just tried me.close as
well. All have the same effect.

The tooltips work with the first .showdialog call but not subsequent ones

thanks
Steve

Nov 21 '05 #3
I set the same up here and cant re-produce it I am afraid. If you create a
brand new project with Form1 and Form2, calling Form2 from Form1, does this
still fail. It may be that something is corrupted in your project or some
other oddity has occured

Try that first and lets see where we gor from there

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"Steve Cutting" <sc******@optusnet.com.au> wrote in message
news:cu********************************@4ax.com...
On Fri, 8 Oct 2004 14:11:22 +0100, "One Handed Man \( OHM - Terry Burns
\)"
<news.microsoft.com> wrote:
Are you using 2003 or 2003, I have no problems on 2003. Also how are you
closing and re-opening the form ?


Hi Terry,

Using 2003. The form is opened using .showdialog from another form.
Closing via dialogresult.OK/cancel or close button. Just tried me.close as
well. All have the same effect.

The tooltips work with the first .showdialog call but not subsequent ones

thanks
Steve

Nov 21 '05 #4
On Fri, 8 Oct 2004 14:31:40 +0100, "One Handed Man \( OHM - Terry Burns \)"
<news.microsoft.com> wrote:
I set the same up here and cant re-produce it I am afraid. If you create a
brand new project with Form1 and Form2, calling Form2 from Form1, does this
still fail. It may be that something is corrupted in your project or some
other oddity has occured

Try that first and lets see where we gor from there


Yes I just tried that in order to isolate it from my project.

Here is what I just did...

Started a new project
Created form1 with 1 button
Created form2 with 1 button
Added tooltip to form2 and set tooltip text for the button
Put the following in form 1..

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

private f2 as new form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

f2.ShowDialog()

End Sub

End Class
This fails as I have described. form2 will only display the tooltip on the
first open

thanks again
Steve
Nov 21 '05 #5
Change your code to this and it will work. . . .
private f2 as form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

f2= new Form2
f2.ShowDialog()

End Sub

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"Steve Cutting" <sc******@optusnet.com.au> wrote in message
news:b4********************************@4ax.com...
On Fri, 8 Oct 2004 14:31:40 +0100, "One Handed Man \( OHM - Terry Burns
\)"
<news.microsoft.com> wrote:
I set the same up here and cant re-produce it I am afraid. If you create a
brand new project with Form1 and Form2, calling Form2 from Form1, does
this
still fail. It may be that something is corrupted in your project or some
other oddity has occured

Try that first and lets see where we gor from there


Yes I just tried that in order to isolate it from my project.

Here is what I just did...

Started a new project
Created form1 with 1 button
Created form2 with 1 button
Added tooltip to form2 and set tooltip text for the button
Put the following in form 1..

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

private f2 as new form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

f2.ShowDialog()

End Sub

End Class
This fails as I have described. form2 will only display the tooltip on the
first open

thanks again
Steve

Nov 21 '05 #6
On Fri, 8 Oct 2004 15:31:07 +0100, "One Handed Man \( OHM - Terry Burns \)"
<news.microsoft.com> wrote:
Change your code to this and it will work. . . .
private f2 as form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

f2= new Form2
f2.ShowDialog()

End Sub

Thanks Terry. Yes this works but I don't see why it should be necessary to
instanciate a new form every time. After all a form called with .showdialog
just hides when you close it, and just sits there ready to be opened again.
As such you only need one instance if that's how you're using it.
That's how I use most of the forms in my program, and it's only these
tooltips that have caused problems.

I'm thinking this must just be a bug ??

thanks again
Steve

Nov 21 '05 #7
When a form is closed, all resources created within the object are closed
and the form is disposed. If you simply want to hide the form from view use
the Hide() method.

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
--
"Steve Cutting" <sc******@optusnet.com.au> wrote in message
news:u6********************************@4ax.com...
On Fri, 8 Oct 2004 15:31:07 +0100, "One Handed Man \( OHM - Terry Burns
\)"
<news.microsoft.com> wrote:
Change your code to this and it will work. . . .
private f2 as form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

f2= new Form2
f2.ShowDialog()

End Sub

Thanks Terry. Yes this works but I don't see why it should be necessary to
instanciate a new form every time. After all a form called with
.showdialog
just hides when you close it, and just sits there ready to be opened
again.
As such you only need one instance if that's how you're using it.
That's how I use most of the forms in my program, and it's only these
tooltips that have caused problems.

I'm thinking this must just be a bug ??

thanks again
Steve

Nov 21 '05 #8
Hi Steve

There are undoubtedly problems with the way the tooltip control works. It
has been the subject of some recent threads.

I have had a similar problem, where clicking a button on a form, for
example, stops the tooltip working for that control. I have got round this
by handling the MouseEnter event for each control that has a tooltip, and
explicitly setting the text for the tooltip every time the event fires. It
shouldn't be necessary, but it works, and it may well get round your problem
as well.

HTH

Charles
"Steve Cutting" <sc******@optusnet.com.au> wrote in message
news:u6********************************@4ax.com...
On Fri, 8 Oct 2004 15:31:07 +0100, "One Handed Man \( OHM - Terry Burns
\)"
<news.microsoft.com> wrote:
Change your code to this and it will work. . . .
private f2 as form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

f2= new Form2
f2.ShowDialog()

End Sub

Thanks Terry. Yes this works but I don't see why it should be necessary to
instanciate a new form every time. After all a form called with
.showdialog
just hides when you close it, and just sits there ready to be opened
again.
As such you only need one instance if that's how you're using it.
That's how I use most of the forms in my program, and it's only these
tooltips that have caused problems.

I'm thinking this must just be a bug ??

thanks again
Steve

Nov 21 '05 #9
On Fri, 8 Oct 2004 16:40:39 +0100, "Charles Law" <bl***@nowhere.com> wrote:
Hi Steve

There are undoubtedly problems with the way the tooltip control works. It
has been the subject of some recent threads.

I have had a similar problem, where clicking a button on a form, for
example, stops the tooltip working for that control. I have got round this
by handling the MouseEnter event for each control that has a tooltip, and
explicitly setting the text for the tooltip every time the event fires. It
shouldn't be necessary, but it works, and it may well get round your problem
as well.


Thanks Charles. I ended up with the following solution which seems to work.
I just create a new instance of the tooltip in my form_load event. The
tooltips now display as expected for each .showdialog call.

thanks again
Steve
Public Class form2
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

private ToolTip1 as tooltip

Private Sub form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'initialise tooltips
ToolTip1 = New ToolTip
ToolTip1.SetToolTip(button1, "tooltip text 1")
ToolTip1.SetToolTip(button2, "tooltip text 2")

end sub

end class
Nov 21 '05 #10
On Fri, 8 Oct 2004 16:30:16 +0100, One Handed Man ( OHM - Terry Burns )
wrote:
When a form is closed, all resources created within the object are closed
and the form is disposed. If you simply want to hide the form from view use
the Hide() method.


I don't believe that the form is disposed when closed after a .showdialog.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #11
On Mon, 11 Oct 2004 09:46:27 -0500, Chris Dunaway wrote:
I don't believe that the form is disposed when closed after a .showdialog.


Further info from the docs:

When a form is displayed as a modal dialog box, clicking the close form
button (the button with an "X" at the top right of the form) causes the
form to be hidden and the DialogResult property to be set to
DialogResult.Cancel. Unlike modeless forms, the Close method is not called
by the .NET Framework when the user clicks the close form button of a
dialog box or sets the value of the DialogResult property. Instead the form
is hidden and can be shown again without creating a new instance of the
dialog box. Because a form displayed as a dialog box is not closed, you
must call the Dispose method of the form when the form is no longer needed
by your application.
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #12

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

Similar topics

1
by: David Ei | last post by:
I'm working on a C# Windows Forms application that is leaking memory. I've been using the SciTech NetMem Profiler 2 (A really great tool, BTW) to track down leaks. I've found one related to...
0
by: ADavis | last post by:
We have an existing ActiveX control that plots data points over an image. When the mouse is moved over these points, a tool tip is supposed to be displayed indicating information about the point....
3
by: David Hayes | last post by:
I've made tooltips work in Firefox*, but tooltip doesn't appear at the specified location until the SECOND time that the user passes the mouse over the location with the mouseover event. What I...
1
by: Wayne Aprato | last post by:
Tooltips in Access have not worked on my machine for a long time despite several reinstalls of the operating system and applications at fairly regular intervals. I have finally pinned down the...
0
by: glhanson | last post by:
I am using the AxWebBrowser control to display a simple HTML page on a windows form. I want to display tooltips using the title attribute for the hrefs. The tooltips work fine when the HTML is...
2
by: David Batt | last post by:
Hello I have a problem whereby I wish to setup a custom tooltip. I have the code attached to do this, it all works very wel if you have the following code in a button click event on the form ...
1
by: TyBreaker | last post by:
I have a simple form with a toolstrip on it and some toolstrip buttons. Tooltips work fine. But then I use the ShAppBarMessage API call to register the form as an Application Desktop Toolbar. ...
9
by: timnels | last post by:
I have an issue where I have a user control that is launched into a floating form. At some point later, I allow the user to "unfloat" the user control by reparenting it on a split container in...
3
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
Hi, Is it possible to access menustrips and tooltips from the IDE when they are present on a form from which you have inherited? I would like to have a template form from which a bunch of forms...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
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,...
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,...

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.