How can I set the cursor to hand when it moves in specific areas of a picturebox???
I have this function of a picturebox class, it highlights some area of a picture box, and I want when the user moves the mouse to these points of area the cursor to be hand but only in these areas that I am highlighting.
Public Function HighlightTriangle(ByVal ResultDice As Byte)
Dim graphics As System.Drawing.Graphics = Me.CreateGraphics()
Dim g As System.Drawing.Graphics = Me.CreateGraphics()
Dim brsh As SolidBrush
'New SolidBrush(Color.FromArgb(130, 255, 255, 0))
Dim points(CType(Trigwna(0), ArrayList).Count - 1) As Point
For i As Integer = 0 To CType(Trigwna(ResultDice), ArrayList).Count - 1
points(i) = CType(CType(Trigwna(ResultDice), ArrayList)(i), Point)
Next
g = Me.CreateGraphics()
brsh = New SolidBrush(Color.FromArgb(130, 255, 255, 0))
g.FillPolygon(brsh, points)
[highlight #EF2929][highlight #EF2929]Me.Cursor.Draw(g, g.FillPolygon(brsh, points))[/highlight]
Error Expression does not produce a value. [/highlight]
Me.Cursor = Windows.Forms.Cursors.Hand
brsh.Dispose()
g.Dispose()
Return Me
End Function
I' am unexperience at graphics and it's the first time I use them. Any help will be much appreciated.
Thank you in advanced
I have this function of a picturebox class, it highlights some area of a picture box, and I want when the user moves the mouse to these points of area the cursor to be hand but only in these areas that I am highlighting.
Public Function HighlightTriangle(ByVal ResultDice As Byte)
Dim graphics As System.Drawing.Graphics = Me.CreateGraphics()
Dim g As System.Drawing.Graphics = Me.CreateGraphics()
Dim brsh As SolidBrush
'New SolidBrush(Color.FromArgb(130, 255, 255, 0))
Dim points(CType(Trigwna(0), ArrayList).Count - 1) As Point
For i As Integer = 0 To CType(Trigwna(ResultDice), ArrayList).Count - 1
points(i) = CType(CType(Trigwna(ResultDice), ArrayList)(i), Point)
Next
g = Me.CreateGraphics()
brsh = New SolidBrush(Color.FromArgb(130, 255, 255, 0))
g.FillPolygon(brsh, points)
[highlight #EF2929][highlight #EF2929]Me.Cursor.Draw(g, g.FillPolygon(brsh, points))[/highlight]
Error Expression does not produce a value. [/highlight]
Me.Cursor = Windows.Forms.Cursors.Hand
brsh.Dispose()
g.Dispose()
Return Me
End Function
I' am unexperience at graphics and it's the first time I use them. Any help will be much appreciated.
Thank you in advanced