@Peter Simpson's solution is correct but a bit cryptic. The reason is that "ClickPnl.tag" is an unspecified object. The solution works because the right hand of the = is converted to the type of the left.
You could also use "If ClickPnl.Tag.As(Int) = 4 Then"
In fact, I think this is the way @Erel recommends in this thread
New warning:
"Comparison of Object to other types will fail if exact types do not match.
Better to put the object on the right side of the comparison. (warning #35)"