Problem with checkbox in scrollview

zetadan

Member
Licensed User
Longtime User
I have a checkbox which I added programatically inside a scrollview. It works fine as far as checking and unchecking.

Here is the problem:

The subroutine checkbox1_checkedchange(checked as boolean) does not get triggered when I click the checkbox1.

Checkbox1 is dimensioned and added to a panel inside the scrollview and definitely "works" as far as it is clickable.

I have tested a checkbox not in the scrollview and added via the designer and it runs the subroutine fine.

Any ideas would be greatly appreciated.

Dan
 

zetadan

Member
Licensed User
Longtime User
Thanks so much Dman!

I have it working now but I have a new problem.

Whenever I programatically check the box it runs the subroutine. This makes it much more difficult to initialize the status of the checkbox. Also I have multiple checkboxes and some of them are dynamic (changing without user input). I do not want to initiate the event when I am changing or setting the checkbox states.

Dman or anyone have any ideas?
 
Upvote 0

JesseW

Active Member
Licensed User
Longtime User
Thanks so much Dman!

I have it working now but I have a new problem.

Whenever I programatically check the box it runs the subroutine. This makes it much more difficult to initialize the status of the checkbox. Also I have multiple checkboxes and some of them are dynamic (changing without user input). I do not want to initiate the event when I am changing or setting the checkbox states.

Dman or anyone have any ideas?

i would create a global boolean variable, probably call it something like manualCheckUpdate, initialized to false. immediately before i programatically changed a checkbox, i'd set this global boolean to true. inside the checkChanged event, i'd first test this global boolean and if it was true, i'd set it back to false and immediately exit the sub. its the simplest way i know of to inform the event that you're doing manual updates.

cheers
 
Upvote 0

zetadan

Member
Licensed User
Longtime User
Good idea Jesse.

If I can't prevent it from triggering, I think this might be the best way to handle this.

Thanks
 
Upvote 0
Top