By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

ToolTips on Controls Added to a tabPage

P: 1
I read MadApe's solution ( to a problem I am having, too, with ToolTips that are set to labels and richtextboxes added onto a tab page, in VB 2010 (Windows 7, 32-bit). Like MadApe's, my ToolTips did not appear, and I couldn't figure it out. I'm not a great programmer, was having trouble, and then spotted his page, which seemed to address the issue. My program Adds labels, rich boxes and lines connecting them to each other on a tab page programmatically (the labels, rich boxes and lines are in arrays, and the lines are also in arrays, in VB Power Pack, just like MadApe's). As I created and added each label and RTB, I set the ToolTip text for each control. If I understand MadApe, he discovered that he needed to add the labels and richtextboxes and Set the tooltip for each one BEFORE he added the lines. My code for adding labels, RTB's and lines was all in one loop, so I adjusted my code so that it loops through the creation of new labels and rich boxes, sets the tooltip for each one, then ends the loop; then I start a new loop just for the lines, dimensioning a canvas for the drawing on the same TabPage. The labels, richtextboxes and lines work fine, and yay, so do the tooltips, but only through the first user pass. The second time the user clicks a button to create the labels, rtb's and lines, my program has to Dispose of the existing labels, rich boxes, and lines, then it goes through the same loops I described above to create new ones. [I use .Dispose() for the labels, rich boxes and lines, with the usual
Expand|Select|Wrap|Line Numbers
  1. If(Not Mylabel(j) is Nothing) then...
type code to dispose and set to nothing (I hope that is right). I also guessed that I needed to dispose of my canvas, so I do that, too.] So, what happens is that after that disposal, the program correctly creates labels, rich boxes and lines as it did the first time, attempting to add the tooltips again as it did correctly the first time, but this time the tooltips are gone. I'm back to where I was. Does anyone know why this should happen, and what I can do? I'm attaching some snippets. Many thanks in advance.
Attached Files
File Type: txt CodeForLoopingthroughAddcontrols.txt (2.0 KB, 206 views)
Jan 14 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.