Hi,
Thank you both for taking time and trying to help me...
I know I can extend a class by deriving from it and add my properties and I
also know Extender Providers to add properties to controls. But both of
these solutions are again static, I mean I hardcode which properties will be
added to my standart control. My problem was creating properties on the fly,
this means when I instance an object in my applicaiton, I add properties
into it and it becomes a modified class.
Anyway, I could find the solution at here :
http://www.codeproject.com/cs/miscct...g_property.asp
I hope it will be usefull for anybody in a situation like me...
Thanks again,
Özden
"J L" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Ozden,
> Check out this link:
>
> http://msdn.microsoft.com/library/de...et04082003.asp
>
> Shows the use of Extender Providers to add properties, etc. to
> textboxes but could work with any control. Well written article and
> the download shows the source code. I used it to develop my own text
> validator using much of Mr. Hollis' ideas but changing the overall
> behavior to suit my needs.
>
> John
>
> On Wed, 9 Mar 2005 10:15:36 +0200, "Özden Irmak"
> <ozdenirmak(at)isnet.net.tr> wrote:
>
>>Hi,
>>
>>I've developed a couple of Windows Forms controls. To extend their
>>flexibility, in run-time, I should be able to define/add new properties
>>for
>>those controls.
>>
>>I know that Reflection.Emit namespace is for that purpose. I have searched
>>for possible examples about this and only found the ones which create the
>>assembly, module and properties (As a whole) from scratch. But I want to
>>add
>>new properties to an existing Class?
>>
>>Does anybody have any example about this? I need examples such as how to
>>retrieve mehtodbuilder from an exsiting class, etc. to add new properties?
>>
>>Thanks in advance,
>>
>>Özden
>>
>