Hi Everyone,
I have a custom control which is having some child controls in it. My requirement is like when an event is attached to parent control. the child controls also should respond to the same event i.e i want to pass the parent control event to child control. And before attaching the event handler i want to check parent control is having handler for that event or not. I have tried the code like below but its not working(checking for mouse click event)
Type classType = ParentObj.GetType();
FieldInfo eventField = classType.GetField("MouseClick", BindingFlags.GetField| BindingFlags.NonPublic
| BindingFlags.Instance);
EventHandler eventDelegate = (EventHandler)eventField.GetValue(this.pdfViewer1);
//// eventDelegate will be null if no listeners are attached to the event
if (eventDelegate == null)
{
return null;
}
Suggestions needed.
Regards,
Natiq