473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Add properties to a control at Run-Time?

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
Nov 16 '05 #1
3 3039
You can create a new class inherited from the original class and add your
new properties.

Tiansong Pu

"Özden Irmak" <ozdenirmak(at)isnet.net.tr> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Nov 16 '05 #2
J L
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


Nov 16 '05 #3
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" <jo**@marymonte.com> wrote in message
news:bh********************************@4ax.com...
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

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David Pokorny | last post by:
I'd like to be able to take a function or other chunk of code (that someone else has written), run it for, say 50 byte codes, and then return control back to my program/controlling thread until my...
6
by: JMe9ka | last post by:
I've been gnawing at this problem for the past two days with little progress. My intent is to create a table or grid that looks and functions like the Properties window in Visual Studio.NET. I'm...
2
by: msnews.microsoft.com | last post by:
It appears myButton_OnClick is triggering in my user control AFTER its parent's Page_Load already runs. Is there a way to make the parent Page_Load to run afterwards? I'm changing a session...
0
by: roni | last post by:
i created WINDOW user control (not web user control), that connect via socket to server. this WINDOW user control will be host in the IE . when the page is run, the WINDOW user control is load,...
1
by: CarterABarnes | last post by:
Hello fellow vb.net developers, Here is my issue. I am creating an application that very much needs a control like the Properties control in Visual Studio. I would like to add items to it that...
4
by: Dave Calkins | last post by:
I have a native Win32 C++ app built with Visual Studio 2005. I'd like to make use of a property grid control in this app. For an example of this, in Visual Studio, see the properties control...
16
by: bartj1 | last post by:
Hi, I did a benchmark comparison of a National Instruments Active-x "Strip Chart" control in both Vb5 and vb.net(2005). The code is identical: For I = 1 to 10000 ARR(1,0) = J...
5
by: Jon Pope | last post by:
I've got a class which contains properties. I can supply this class to the Properties control, and it will properly display the properties and allow the user to edit them, etc. I would like to be...
2
by: menyki | last post by:
use visual.net to develope software, now i want to start using java. i have been able to install netbeans 5.5, my sql and jdk. i have been also able to drag control to jpane. my problems are, i find...
11
by: Web Search Store | last post by:
Hello, I set up a web page with 2 user controls. In classic asp, the first one did all the declarations, and the second one used the values, and could reset it. In ASP.Net so far I can't...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.