473,785 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ToolTip stops working after I dismiss the window once

I have a dialog that I bring up as an options dialog. I have a variable for
this dialog as a member of the main application form and I create it in the
constructor. I bring up the dialog by calling
MyOptionsDialog .ShowDialog(thi s) and I check the DialogResult in an if
statement.

The dialog has an owner draw ListBox that contains some UserControls I
created. Each of those controls has a TooTip in it. The tool tip works
fine the first time I call ShowDialog, but every time it gets called after
that there are no tool tips for the items in the ListBox of the dialog.
Everything else about it works fine, I can click the UserControls and scroll
the ListBox. I know I must be doing something wrong. I tried catching the
Closing message and setting the e.Cancel property to true to see if it would
make a difference, but it did not.

Any ideas? Is there a way to reinitialize the tool tip? I tried putting
calls to SetToolTip in the OnVisibleChange d event of the UserControl but
that doesn't help.

Thanks,
jim
Nov 16 '05 #1
6 4005
Hi Jim,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that the tooltip is not showing correctly in
your owner draw listbox. If there is any misunderstandin g, please feel free
to let me know.

I have tried it with the code you have sent me last time. I added a tooltip
object and set tooltips when the usercontrol GaugeStyleSelec t loads.

this.toolTip1.S etToolTip(this. m_chkUseGauge, "Hello");
this.toolTip1.S etToolTip(this. m_rbAnalog, "Hello");
this.toolTip1.S etToolTip(this. m_rbDigital, "Hello");

However, it works fine on my computer when I open and close the dialog box
again and again. Could you let me know where did you add the tooltip to
controls? Or could you show us some of the code? Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #2
I added the tooltip on the usercontrol GaugeStyleSelec t, just like the
project I sent you. I create the dialog once in the main form and keep
reusing that dialog. The Apply button has its DialogResult property set to
"OK". In the test app I sent you the dialog is created and displayed in the
OnTestClick from "button1". In my real app it is created in the constructor
of the main form and there is a menu item that has a Clicked event that
calls m_AlreadyCreate dGaugeOptDlg.Sh owDialog(this).

The first time that object is displayed by calling ShowDialog tooltips work
fine. The next time that same dialog object is dispayed, using
ShowDialog(this ), the tool tips no longer work.

The code in Form1.cs looks like this:
private GaugeOptions lDlg = new GaugeOptions();

private void OnTestClick(obj ect sender, System.EventArg s e)
{
lDlg.ShowDialog (this);
}
Jim

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:Jj******** ******@cpmsftng xa10.phx.gbl...
Hi Jim,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that the tooltip is not showing correctly
in
your owner draw listbox. If there is any misunderstandin g, please feel
free
to let me know.

I have tried it with the code you have sent me last time. I added a
tooltip
object and set tooltips when the usercontrol GaugeStyleSelec t loads.

this.toolTip1.S etToolTip(this. m_chkUseGauge, "Hello");
this.toolTip1.S etToolTip(this. m_rbAnalog, "Hello");
this.toolTip1.S etToolTip(this. m_rbDigital, "Hello");

However, it works fine on my computer when I open and close the dialog box
again and again. Could you let me know where did you add the tooltip to
controls? Or could you show us some of the code? Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #3
Hi Jim,

I have reproduced it and is researching on it. Will post back ASAP. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #4
Hi Jim,

Based on my research, it seems that this is the default behavior of windows
forms. I assume that you're calling SetToolTip in Form.Load event. However,
if the Form object is not disposed, the Load event will not be fired again.
So, the tooltip is not shown. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #5
Why does it go away in the first place? Is there a way to prevent this?
How do I go about getting them back?

jim

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:E1******** ******@cpmsftng xa10.phx.gbl...
Hi Jim,

Based on my research, it seems that this is the default behavior of
windows
forms. I assume that you're calling SetToolTip in Form.Load event.
However,
if the Form object is not disposed, the Load event will not be fired
again.
So, the tooltip is not shown. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #6
Hi Jim,

The first time the form is loaded, Form.Load event is fired. However, the
second time, it is not fired again since we didn't "new" the object.
Currently I haven't found a workaround to prevent this. Could you try to
dispose the form and new it again?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #7

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

Similar topics

0
1966
by: Robert | last post by:
Stephen, I think I figured out the problem. I was able to get Check Boxes and Option Buttons to work on my form by TURNING OFF RECORD SELECTORS on the form. Not sure why this would make a difference. Perhaps Access attributes the hWnd of the form to the Record Selector if these are turned on. In any case, I ran some tests on your Customers form and sure enough, a Check Box or Option Button will work fine until you turn on Record...
6
403
by: ltt19 | last post by:
HI everyone, So, I have many buttons, and all of them must show a tooltip with the same string, except one word, that I must read this owrd from a variable. Although, the "ToolTip on x" property do not let me to write a little paramter of concanatantion (at least I was not able to do this). Does someone has any ideas? Any help will be very useful. Thanks in advance.
3
4671
by: Rainer Queck | last post by:
Hi NG, working on a project in VS2005 I started to add ToolTips. My problem now is, that each ToolTip only shows once. mouving the mouse over a button shows its tooltip, moving to the next button show the coresponding tooltib. If I now move back to the first button the tooltip does not popup again. Is there "some setting" responsible for that? What must I do, that the tooltip is shown every time the mouse moves over the control?
1
2054
by: =?Utf-8?B?RnJlZEM=?= | last post by:
My application uses the tooltip to display "realtime" data. When a user hovers over a control, information like temperatures and pressures are displayed in the tooltip. Using tootip.SetToolTip(controlName,text) the controls tooltip is updated every second. There are 50+ of these controls on a form. I have used perfmon and graphed the working set of my application to track this problem to the tooltip method. With tooltip.SetToolTip...
3
2587
omerbutt
by: omerbutt | last post by:
hi there i have downloaded a prototype tooltip from http://www.nickstakenburg.com/projects/prototip/ the logic it uses is to call the script after creating the <div> for example i am using the ajax method <html> <body> <div id='my_div'> </div>
16
2778
by: Charles Law | last post by:
I have to take this personally now. Tooltips have been flakey since the dawn of .NET, but to still have to put up with a disappearing tooltip in VS 2008 is getting beyond a joke. Tooltips have always done this, so isn't it about time they were fixed? I have a tooltip that I assign to a button control on my form. I hover over the button and up pops the tooltip. I move away and the tooltp fades. I hover again, and back comes the tooltip....
5
2523
omerbutt
by: omerbutt | last post by:
hi there i have a link in my pge and on mouseover i want to show the tooltip by getting the coordinates x and y from the screen where the onmouseover event occoured can any one teell me the way to get the right coordinates in IE and FF my code is not working properly or say it is not a generic code that i could reuse it has the positioning problem so in all my sites where i have to use the tooltip i have to position is manually on that page...
7
2448
by: freddukes | last post by:
Okay... So this is my first project and I want to be able to make a tool tip appear with the basket contents whenever you hover over a link using the onmousehover='javascriptFunction()'. I have acquried (and modified) some javascript code, but it did not work... So I attempted to create a simple alert() function to test and that did not work either... This is my test codee: // tooltip.js function displayAlert() { alert("Test...
11
2184
by: Kim | last post by:
Using the code below am I able to display/hide a tooltip without any problems, however once the tooltip is displayed its position is fixed (based on where the mouse first hovered onto the object) and I would like the tooltip to follow the mouse instead. What must I change to do this ? HTML <a href="#" onMouseOver="showBox('help','text to display')" onMouseOut="hideBox('help')">text link</a>
0
9645
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
10327
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10151
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
10092
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
8973
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5381
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
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.