-1

I want to show a tooltip every time I hover a graphics object. I used a bitmap to draw a graphics object in the picture box.

JoshDM
  • 4,939
  • 7
  • 43
  • 72
Kevs
  • 1

1 Answers1

0

Picturebox does not have a tooltip feature in visual studio, not that i know of anyway. Here is a work around.

imports System.Drawing    

Dim varname as new ToolTip()
varname.SetToolTip(PictureBox1, "Tooltip data here") 

If you have added the box with WithEvents then use the following code

Private tool As ToolTip = New ToolTip()

Sub OnPictureMouseHover(ByVal sender As Object, ByVal e As EventArgs) Handles PictureBox1.MouseHover
    tool.Show("Tooltip", Me)
End Sub

Sub OnPictureMouseLeave(ByVal sender As Object, ByVal e As EventArgs) Handles PictureBox1.MouseLeave
    tool.Hide()
End Sub
Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81