Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set the cursor to hand when it moves in specific areas of a picturebox???

Status
Not open for further replies.

WomanPro

Programmer
Nov 1, 2012
180
GR
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top