Hi All I have a ListView Control in WindowsForm and also this Listivew has a checkBox I Just want one thing that when userClick on CheckBox I want this Event I used ItemCheck and ItemChecked Event but these event is firing every time even when Firstime my form is loading
A:
Add the following line to the top of your event handler:
if (!this.Visible) return;
SLaks
2010-07-14 13:39:48
If you can't understand what the line does, consider finding another career. (`this` is your form)
SLaks
2010-07-14 13:40:15
A:
The Listview control fires itemcheck and itemchecked (and some other) events sometimes at initialization, provided "by design" by Microsoft at no extra charge. You can set a flag (boolean variable) to tell whether the form has completed the loading process, and abort the handler if not.
xpda
2010-07-15 02:08:21