If your project is an WPF project then you can write this in your event handler:
if(counter < min || counter > max)
{
e.Handled = true;
}
//your code
EDIT If you're using Windows Form so you can do this:
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if(counter < min || counter > max)
{
return;
}
//your code
}