[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I 'blank out' the text of a tooltip?

Posted on 2006-05-25
4
Medium Priority
?
220 Views
Last Modified: 2012-05-05
I use the following sub to display a tooltip. It displays fine. But if I later change the values in my array to 0, the original tooltip text displays. I never get it to not display.  So if arrKToolTip(2) = 182 is the first value, my tooltip displays 182 as it should. But later, I reset arrKToolTip(2) to arrKToolTip(2) = 0. The tooltip still displays 182. Apparently, tooltip text lingers in VB.Net and must be eliminated somehow. I tried tooltip1.RemoveAll() but that did nothing either.

My goal is to have the tooltip no longer show up if I clear the contents of the textbox when no longer needed for display. What am I missing? Thank you in advance for your assistance.

Private Sub txtKZone3_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles  txtKZone3.MouseHover
        Dim tooltip1 As New ToolTip
        Dim strToolTip As String

        strToolTip = arrKToolTip(2).ToString

        If arrKToolTip(2) = 0 Then
            strToolTip = ""
        End If
        tooltip1.SetToolTip(txtKZone3, strToolTip)

    End Sub
0
Comment
Question by:IT_Steve
  • 2
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
vadim63 earned 1000 total points
ID: 16763467
Private Sub txtKZone3_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles  txtKZone3.MouseHover
        Dim tooltip1 As New ToolTip
        Dim strToolTip As String

        strToolTip = arrKToolTip(2).ToString

        If arrKToolTip(2) = 0 Then
            tooltip1.Active = False
        Else
            tooltip1.Active = True        
        End If
        tooltip1.SetToolTip(txtKZone3, strToolTip)

    End Sub
0
 

Author Comment

by:IT_Steve
ID: 16763655
Even with tooltip1.Active = False, the tooltip still displays the original value. It may help to know, if I do not  hover over the textbox during the forst time the array value is set to a non-zero value, when I set it to 0, it will not display any tooltip.  I did display a messagebox to verify I was in the right part of my IF condition so it should have been setting tooltip1.active to false.
0
 
LVL 10

Expert Comment

by:vadim63
ID: 16763943
What kind of array is arrKToolTip()?
0
 

Author Comment

by:IT_Steve
ID: 16763963
I defined my tooltip outside of the mouse_hover sub and my problem is solved. It occurred to me that the sub declares a New tooltip each time so I am not actually 'blanking out' the old one.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

867 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