Hi Sunny,
Again, thanks for the help. The code you supplied is really good, but the
thing is I am trying to clone the standard controls, or simply, controls that
i didn't create.
i found an incomplete solution ("Clone control in run-time?") written by
someone from microsoft (Jeffrey Tan) and he seems to know how to do this.
Unfortunately, cloning the event was not elaborated. he might not be
monitoring this newsgroup anymore.
he explained the process of cloning the control and proceeded with saying...
"2. You also need to use TypeDescriptor.GetEvents and
TypeDescriptor.GetAttributes methods to copy the events and attributes. "
I've been playing around with this classes but haven't been lucky.
Thanks,
Ren
Sunny - 11 Feb 2005 16:53 GMT
> Hi Sunny,
>
[quoted text clipped - 6 lines]
> Unfortunately, cloning the event was not elaborated. he might not be
> monitoring this newsgroup anymore.
He is, he just answered to my other question.
> he explained the process of cloning the control and proceeded with
> saying...
>
> "2. You also need to use TypeDescriptor.GetEvents and
> TypeDescriptor.GetAttributes methods to copy the events and attributes. "
In that case you do not have a choice but to use reflection. I haven't done
that for events, but I have done this to access other private members of a
class. When I'm back in the office in Monday, I'll try to find and post a
sample code.
> I've been playing around with this classes but haven't been lucky.
>
> Thanks,
> Ren
Cheers
Sunny