Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Getting at the Parent of a Component

Back to Forum: Tech Off
  • User profile image

    I have a custom componet (inherets from System.ComponentModel.Componet) and I am trying to find the Type of the Container to this component. I wasn't sure what to use, so I tried the Container property and the Site property and neither gave me anything when I called GetType().

    My component has a string property that defines an event in the parent. Once I know what the event is, I want to wire up an EventHandler in my component to the event specified in the property.

    If someone can help me, I would really appreciate it. I have been stuck on this for a while.


  • User profile image

    Container and Site should give you something, even if its null.. GetType().ToString(); try that and see what has been given.. then on that, cast your sender object of the event as that type and you can utilize it.


Conversation locked

This conversation has been locked by the site admins. No new comments can be made.