private flagok as boolean private sub Check() if x < 10 then flagok = false else flagok = true end if end sub Private Sub picmouseclick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) if not flagok then exit sub end if End Sub