I have a checkbox X1 that if checked it will check a column of checkboxes.

What i'm trying to do is if the user unchecks at least one checkbox from the column it will uncheck checkbox X1. But I don't want it to run the event from checkbox X1 again because that will cause the whole column of checkboxes to be unchecked. Is there a way to skip the event when its not needed?

6 Years
Discussion Span
Last Post by ninjatalon

I typically add a global SuppressEvent variable of boolean.

In the check event it should start with

If SuppressEvent then Exit Sub

Before making the checkchange set SuppressEvent = true and right after the call set SuppressEvent = false.

That should solve your problem.


Thanks again Unhnd_Exception

I have done this before but I was wondering maybe there a built-in action that vb.net uses. Tried Google it but nothing came up.

But I guess it looks like creating a flag is the only thing thats stops it. Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.