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.
Asked
Active
Viewed 145 times
-1
-
I tried to make shapes(polygon) but now I will used the MouseHover event and put tooltip everytime I hover to those graphics objects. – Kevs Aug 04 '15 at 17:39
-
@Kevs did you try my answer – Rachel Gallen Aug 04 '15 at 17:40
-
@Kevs if my answer works will you click the tick that appears beside the answer when you hover beside it. it should turn green. thanks – Rachel Gallen Aug 04 '15 at 17:56
-
clarified a few points and corrected usage of 'a' – JoshDM Aug 06 '15 at 18:42
1 Answers
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
-
otherwise there is a solution using a form control here http://stackoverflow.com/a/5545317/1675954 – Rachel Gallen Aug 04 '15 at 17:40
-
-
-
-
I draw shapes using graphics and put it on a bitmap and overlay it to the picture box. After that, I want to use the mouse_hover event(PictureBox1) to show tooltip every time I hover in an graphics objects. – Kevs Aug 04 '15 at 17:49