Results 1 to 3 of 3

Thread: what does modifiers protected and friends do?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    34

    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

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    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

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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
  •  



Click Here to Expand Forum to Full Width