Hello, is it possible to change the cursor to hand in a highlighted area of a picture box as a triangle or rectagle for example? How can I achieve that? May anyone guide me please?
I was thinking to create a class for Triangle for example but I don't know if I am thinking right, because I have to do with points and coordinates of points. What I need to do that?
I would like an example, or further explanation and suggestions about this. Any help will be much appreciated. Thank you so much in advanced.
Public Function HighlightTriangle(ByVal ResultDice As Byte, _
ByRef GrpSmpleDice As GroupSmpleDice, ByRef GrpDblDice As GroupDblDice, ByVal DblDice As Boolean) As RectangleOfTriangle
Dim graphics As System.Drawing.Graphics = BrdPB.CreateGraphics()
Dim g As System.Drawing.Graphics = BrdPB.CreateGraphics()
Dim brsh As SolidBrush
Dim Highlighted As Boolean = False
Dim Rect As New RectangleOfTriangle
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
If DblDice = False Then
If GrpSmpleDice.FrstDice And ResultDice = Me.Rd1 - 1 Then
RectInst1 = BrdPB.SquareTriangles(ResultDice)
Rect = RectInst1
USDices.Hlght1 = True
End If
If GrpSmpleDice.ScndDice And ResultDice = Me.Rd2 - 1 Then
RectInst2 = BrdPB.SquareTriangles(ResultDice)
Rect = RectInst2
USDices.Hlght2 = True
End If
Else
With GrpDblDice
If ResultDice = Me.Rd1 - 1 And .FrstDice Then
RectInst1 = BrdPB.SquareTriangles(ResultDice)
Me.RectI1 = RectInst1
End If
If ResultDice = Me.Rd2 - 1 And .ScndDice Then
RectInst2 = BrdPB.SquareTriangles(ResultDice)
Me.RectI2 = RectInst2
End If
If ResultDice = Me.rd3 - 1 And .ThrdDice Then
RectInst3 = BrdPB.SquareTriangles(ResultDice)
Me.RectI3 = RectInst3
End If
If ResultDice = Me.rd4 - 1 And .FrthDice Then
RectInst4 = BrdPB.SquareTriangles(ResultDice)
Me.RectI4 = RectInst4
End If
Rect = BrdPB.SquareTriangles(ResultDice)
End With
End If
g = BrdPB.CreateGraphics()
brsh = New SolidBrush(Color.FromArgb(130, 255, 255, 0))
g.FillPolygon(brsh, points)
brsh.Dispose()
g.Dispose()
Return Rect
End Function
I was thinking to create a class for Triangle for example but I don't know if I am thinking right, because I have to do with points and coordinates of points. What I need to do that?
I would like an example, or further explanation and suggestions about this. Any help will be much appreciated. Thank you so much in advanced.
Public Function HighlightTriangle(ByVal ResultDice As Byte, _
ByRef GrpSmpleDice As GroupSmpleDice, ByRef GrpDblDice As GroupDblDice, ByVal DblDice As Boolean) As RectangleOfTriangle
Dim graphics As System.Drawing.Graphics = BrdPB.CreateGraphics()
Dim g As System.Drawing.Graphics = BrdPB.CreateGraphics()
Dim brsh As SolidBrush
Dim Highlighted As Boolean = False
Dim Rect As New RectangleOfTriangle
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
If DblDice = False Then
If GrpSmpleDice.FrstDice And ResultDice = Me.Rd1 - 1 Then
RectInst1 = BrdPB.SquareTriangles(ResultDice)
Rect = RectInst1
USDices.Hlght1 = True
End If
If GrpSmpleDice.ScndDice And ResultDice = Me.Rd2 - 1 Then
RectInst2 = BrdPB.SquareTriangles(ResultDice)
Rect = RectInst2
USDices.Hlght2 = True
End If
Else
With GrpDblDice
If ResultDice = Me.Rd1 - 1 And .FrstDice Then
RectInst1 = BrdPB.SquareTriangles(ResultDice)
Me.RectI1 = RectInst1
End If
If ResultDice = Me.Rd2 - 1 And .ScndDice Then
RectInst2 = BrdPB.SquareTriangles(ResultDice)
Me.RectI2 = RectInst2
End If
If ResultDice = Me.rd3 - 1 And .ThrdDice Then
RectInst3 = BrdPB.SquareTriangles(ResultDice)
Me.RectI3 = RectInst3
End If
If ResultDice = Me.rd4 - 1 And .FrthDice Then
RectInst4 = BrdPB.SquareTriangles(ResultDice)
Me.RectI4 = RectInst4
End If
Rect = BrdPB.SquareTriangles(ResultDice)
End With
End If
g = BrdPB.CreateGraphics()
brsh = New SolidBrush(Color.FromArgb(130, 255, 255, 0))
g.FillPolygon(brsh, points)
brsh.Dispose()
g.Dispose()
Return Rect
End Function