Solved

ToolTip doesn't work for UserControl

Posted on 2007-11-13
21
1,713 Views
Last Modified: 2012-05-05
Hi,
I have a project with some Forms and also UserControls. In the Forms ToolTips pop up but not for UserControls. I believe that I've done everything the same (as there's not much to do, i.e. add ToolTip control to a Form/UseControl and add text to different Form controls).

Should I be doing something more for UserControls than for standard Foms?

/Michael
0
Comment
Question by:gem56
  • 9
  • 5
  • 2
  • +3
21 Comments
 
LVL 5

Expert Comment

by:administradores
ID: 20278327
No, just drag a ToolTip over the Usercontrol and then fill the tooltip text boxes on each control, but i think you have done that.

Try to make a stand-alone project to reproduce the same error.
0
 
LVL 11

Expert Comment

by:AkisC
ID: 20278520
Lets say your Tooltip is named TT1
If there is a ToolTip on TT1 property on your Usercontrol then set the value there
If you have done that and is not working try (On form_Load)
   TT1.AutoPopDelay = 5000
   TT1.InitialDelay = 1000
   TT1.ReshowDelay = 500
   TT1.ShowAlways = True
   TT1.IsBalloon = True
   ' Set up the ToolTip text for ...
   TT1.SetToolTip(youUserControl, "This Is the ToolTip")


0
 
LVL 14

Expert Comment

by:Matti
ID: 20278532
Hi!

Try to set the tooltip on UserControl_Load:

Private Sub UserControl1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ToolTip1.SetToolTip(Button1, "Test")  'Here controls name is button1
   End Sub

Matti
0
 

Author Comment

by:gem56
ID: 20281291
Thanks for all the suggestions.
I've just had some other issues to deal with and I couldn't try the suggestions but I will in the morning, as it's getting very late here.

/Michael
0
 
LVL 5

Expert Comment

by:administradores
ID: 20306545
Hi gem56

Could you work out your issues? i hope so, if not don't hesitate to ask.
0
 

Author Comment

by:gem56
ID: 20306847
Hi guys,
Sorry for not getting back to this sooner, I had other issues take a bit longer than anticipated.

I've tried all your suggestions with mixed luck. No matter what I tried in the original project I just couldn't it working. I then created a new temp project and tried various combinations and guess what (not) it worked every time. So then I used that new UserControl in my original project and guess what (again) it didn't work.

Obviously I'm doing something in my original project that I'm not doing in the new temp project. Obviously I'll keep plugging away and any further suggestions would be most welcome.

/Michael
0
 
LVL 11

Expert Comment

by:AkisC
ID: 20307271
Did any of the suggestions here worked in your temp project?
   If yes=>award points, If no=>ask the moderators to delete the question.
   Either yes -or- no close the question and open anotherone with the new problem.
Have fun coding...
0
 

Author Comment

by:gem56
ID: 20307347
Hi AkisC,
My original problem is that ToolTip doesn't work in my project, and that still remains the case. The part I said worked was me creating a new/Temp project and seeing whether it works there. Seeing it works in the new project however only confirms that I have something wrong in my (original) project.

I've done a bit more digging (on the original project) and have found that ToolTip works on simple Button controls of some Forms but not on other Forms (without even using UserControls). That's a simpler scenario than the initial so I'll follow that path and hope it leads me to a solution or at least to being able to give you guys more info.

/Michael
0
 

Author Comment

by:gem56
ID: 20307544
I have a further bit of info and a few less hairs on my head.

I've found the problem to be due to setting the Forms MdiParent property. If I leave that property set to Nothing then ToolTip works but not my MDI mechanism.

Any ideas how I can have both working?

/Michael
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:gem56
ID: 20307733
I'm now even more confused than before.

As per my previous post, in the main project when I leave MdiParent property set to Nothing the ToolTip function works but I just found that in my temp project I can set the MdiParent property to the Main form and it still works so I'm basically back to square one.

Any thoughts?
0
 
LVL 11

Expert Comment

by:AkisC
ID: 20372901
Hi. Sorry I missed your comments. My internet connection was down for some time.
So as you discribe, you have to deal with microsoft software...
When I find peculiar behavior of forms or controls the first thing I do (for years now) I delete my form or control (keep the code of course) then I save my project, exit the MS programm, then re-open all and re-create the form or control, giving it a new name (if possible {few lines of code to change...})
This has saved me lots of working time, times-and-again...

Take care
0
 

Author Comment

by:gem56
ID: 20379656
Thanks for that.
I'm focusing on something at the moment but will try your suggestion as soon as I get a chance and let you know how I went.

/Michael
0
 
LVL 11

Expert Comment

by:AkisC
ID: 20553859
Hi TheLearnedOne
Happy New Year!
We all try to help here, but if there is not a follow up then we can not focus to the real problem.
I think that [administradores] has given the corrcet direction to the solution.
0
 

Author Comment

by:gem56
ID: 20565669
Hi AkisC and TheLearnedOne,
Once again my apology for not coming back to you on this question sooner, it's not through lack of appreciation but lack of time and frustration at not having any luck every time I do get back to it.

This is the current state (for your info):
I created a new MDI project with several Panels and UserControl that had a few controls and the ToolTip function worked as expected. I then copied that UserControl to my main project and added it to a Panel control in one window and the function didn't work.

I then copied one of my (main project) UserControls to the newly created MDI project (but without any Form code) and the ToolTip function worked. I then added the Form code but didn't set Form.MdiParent property and the ToolTip function worked. I then set the Form.MdiParent property and the (ToolTip) function stopped working.

MY CONCLUSION: The fact that setting Form.MdiParent property in the new project didn't have any adverse effects on the ToolTip function but it does in my main project, I'm still confused. As this question has dragged on and I'm unable to give you any additional info to give you a chance at helping me it's unfair to keep the question open so I agree that it's best to close it as suggested and I'll just plough away at it when I get a chance or new ideas.

Thanks for your input and sorry for (perhaps) appearing ungrateful.

Cheers,
     Michael
0
 
LVL 11

Expert Comment

by:AkisC
ID: 20571149
Hi gem56
I understand what you wrote. There are times that I just leave a moinor problem and continue with the rest of the work. As you wrote "I agree that it's best to close it as suggested"
Happy new year!
0
 

Author Comment

by:gem56
ID: 20589659
Hi guys,
It appears that I've identified the cause of my problem, it's the use of Visual Basic PowerPacks v2.0 shapes.

If I use a LineShape, OvalShape or RectangleShape from the Visual Basic PowerPacks v2.0 in my MDI Container Form then ToolTp stops working but as soon as I remove all of the shapes from the MDI Container form then ToolTip function starts working properly. I've repeated the exercise several times and the same happens every time. I've already had some problems with Visual Basic PowerPacks shapes so I guess this is another one although I don't know if there's a workaround for this one.

Obviously any suggestions would be most appreciated prior to the question being closed, as per above.

/Michael

0
 

Accepted Solution

by:
gem56 earned 0 total points
ID: 20647827
For the benefit of anyone else having the same problem with ToolTip function, I've confirmed that  a bug exists in Visual Basic PowerPacks v2.0 and below is a (simple) workaround solution.

Any time a Visual Basic PowerPacks V2.0 shape is placed on the MDI Container Form the ShapeContainer (that is automatically included) must be placed in the background. I have the following statement in my Form_Load function and that restores the ToolTip function:

          Me.ShapeContainer1.SendToBack()

/Michael
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20682262
Closed, 250 points refunded.
Vee_Mod
Community Support Moderator
0
 

Expert Comment

by:Edward Joell
ID: 24109779
gem56 says "I created a new MDI project "  
and djifrear in tektip states As a side note, if this is a new project you can start a new MDI Project and have Visual Studio create a good template for you, including the menu's and buttons to cascade and arrange the windows.

But In VS 2005 and 2008 I do not see any option in create new projects to create "MDI project"  
You can create a windows application and set the IsMDIContainer property on the initial default form to be true, but I have not seen any way to "create MDI Project"
Is this a template that exist in VS or was djifrear talking about making a user generated template.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now