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?

Recommended Answers

All 2 Replies

Member Avatar

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.