|
-
Jun 30th, 2005, 12:53 PM
#1
Thread Starter
Member
what does modifiers protected and friends do?
what does modifiers protected and friends do?
also, is there any helpful maniputattion of sender as object , e as eventargs
in the event handler?
thanks
-
Jun 30th, 2005, 04:07 PM
#2
Re: what does modifiers protected and friends do?
Protected means the method/data/etc is only visible to the class its declared in, and classes that inherit from that class.
Friend means the method/etc is visible only to classes in the assembly in which it was declared.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jun 30th, 2005, 07:01 PM
#3
Re: what does modifiers protected and friends do?
I'm not sure exactly what your second question is asking, but here's a brief description of the two event handler arguments.
The sender argument is an Object reference to the object that raised the event. If one procedure handles an event for more than one object, you can use the sender argument to determine which object raised the event. You can then cast it as the correct type and, voila, you have access to all the members of the object that raised the event.
The e argument holds information about the event itself. The EventArgs class is not very interesting, but e can be of different types derived from EventArgs, depending on the event. For instance, the Validating event passes e as a CancelEventArgs object, which has a Cancel property. If this property is set to True then the control fails validation and will not lose focus. You should check out all the properties of the e argument for each event you handle.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|