tags:

views:

38

answers:

2

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
If you can't understand what the line does, consider finding another career. (`this` is your form)
SLaks
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