CheckedChanged question

  • Thread starter Thread starter Patrick De Ridder
  • Start date Start date
P

Patrick De Ridder

What is the effect of the following line?
checkBox1_CheckedChanged(null,null);
Thanks,
Patrick.
 
YOu probably won't notice a difference unless you are interrogating either
the sender, eventargs. It'll still behave just like anything else, except
that those two thing will be null, so you won't know what triggered the
event or any of the event args. Off the top of my head, I'm not sure what
benefit you'd derive from doing this but I don't think it would hurt except
that it goes against the whole sender/notification paragidm.
 
What does the line actually do?
Patrick.

William Ryan said:
YOu probably won't notice a difference unless you are interrogating either
the sender, eventargs. It'll still behave just like anything else, except
that those two thing will be null, so you won't know what triggered the
event or any of the event args. Off the top of my head, I'm not sure what
benefit you'd derive from doing this but I don't think it would hurt except
that it goes against the whole sender/notification paragidm.
 
It's just like a function call... I could call a Sum function which takes
in two arguments Sum(1, 1) or 0,0. You need to pass in something b/c it's
expecting something (object and eventargs) but you don't have to do anythign
with them.
 
Back
Top