Adding values to Panel1.Rotation leads to rounding errors and thus the .Rotation value might for example be 89 instead of 90. Use a global variable (0,1,2,3) for the orientation. No need for your Sub CurrentRotation but it will work nonetheless.
' Process_Globals
Private iPanel1Rot As Int = 0
Sub Button2_Click
iPanel1Rot = iPanel1Rot + 1
If iPanel1Rot > 3 Then iPanel1Rot = 0
Select Case iPanel1Rot
Case 1
Panel1.Rotation = 90
Case 2
Panel1.Rotation = 180
Case 3
Panel1.Rotation = 270
Case Else
Panel1.Rotation = 0
End Select
CurrentRotation(Panel1.Rotation)
End Sub