While going through the checkBox I found there is written
CheckBox checkbox = (CheckBox)sender
on checkBox1_CheckedChanged event.
Please explain what it means?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The line simply casts
senderto aCheckBox.Why?
The event handler signature for the
CheckedChangedevent is:So, you need to cast
senderback to aCheckBoxif you want to use anyCheckBoxspecific functionality –objectdoesn’t have much that you can use…This way the
checkboxvariable can be used to get the checkbox Id and operate on the checkbox.