Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to prevent ItemCheck event from firing

Status
Not open for further replies.

tshad

Programmer
Jul 15, 2004
386
US
If I have a CheckedListBox with an ItemCheck event defined, how do I set it to fire only if a user actually selects a checkbox item not when I check it programmatically.

Right now, if I programmatically set all the checkboxes, I will enter the event code 10 times if I have 10 checkbox items.

I don't want it to fire at all here.

But when the user selects a checkbox, then I want it to fire.

Thanks,

Tom
 
tshad,

Shot in the dark here but..

If you set a session var just prior to you program checking the boxes and then tell the event that's auto-firing
to pass over the checking if the session var = what ever. Then at the end of the programmatic checking, clear/change the session var so the event when fired allows the events action.

-dan


sub programmatic code
session("passover")= ("yes")

setting check boxes etc..

session("passover")= = ("no")

End Sub


Sub ckeckbox Event

If session("passover")= ("no") then
do event stuff
end if

end sub

 
The ItemChecked event is available only for a checkboxlist on a Windows Form control, not an ASP.NET checkboxlist control
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top