SelectionRectDrawn Example VB

In this example, when the SelectionRectDrawn event fires, its parameters are evaluated.  A state variable is then set to True or False to indicate whether a selection rectangle has been drawn by the user.

Private Sub ImgEdit1_SelectionRectDrawn(ByVal Left As Long, ByVal Top As Long,
 ByVal Width As Long, ByVal Height As Long)
    'If the parameters returned by this event are all 0, the user
    'has clicked on the image and removed a previously drawn rectangle
    'If parameters have values, a rectangle has been drawn (note that
    'blnIsRectangle would need to be set to False if another image
    'is opened/created or another page is displayed).
    'This technique could also be used for enabling disable cut/copy
    'paste menu picks.
    Dim blnIsRectangle As Boolean
        
    If Width + Height = 0 Then
        blnIsRectangle = False
    Else
        blnIsRectangle = True
    End If
End Sub