473,785 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change property name of existing class

Joe
Is there anyway to change the name or add a property to and existing class
in .NET 1.1?

For example if I have a property called Name and I want to change it to
MyName.

-Joe
Aug 14 '06 #1
5 2294
Hi Joe,

It depends on whether you have the source code of this assembly.

If yes, just change the property name in the code and re-build it. If no,
we cannot change any property name at runtime. If you really need to change
the name of a property, you can make a sub class from this class, and
change the name of certain property in the derived class.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 14 '06 #2
Joe
Sorry I should have explained it better. I would like to change the name at
runtime but I guess it cannot be done.
"Kevin Yu [MSFT]" <v-****@online.mic rosoft.comwrote in message
news:5H******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Joe,

It depends on whether you have the source code of this assembly.

If yes, just change the property name in the code and re-build it. If no,
we cannot change any property name at runtime. If you really need to
change
the name of a property, you can make a sub class from this class, and
change the name of certain property in the derived class.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 14 '06 #3
Hi ,

"Joe" <jb*******@noem ail.noemailwrot e in message
news:O$******** ******@TK2MSFTN GP02.phx.gbl...
Sorry I should have explained it better. I would like to change the name
at runtime but I guess it cannot be done.
Out of curiosity, why you want to do this?

--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Aug 14 '06 #4
Yes, this cannot be done.

Kevin Yu
Microsoft Online Community Support
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 15 '06 #5
"Joe" <jb*******@noem ail.noemaila écrit dans le message de news:
uv************* *@TK2MSFTNGP04. phx.gbl...

| Is there anyway to change the name or add a property to and existing class
| in .NET 1.1?
|
| For example if I have a property called Name and I want to change it to
| MyName.

You can't change anything about an existing class without recompiling the
original class.

You can, however, derive from a class and add another property to reflect
the new name, but the original property will also be available.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Aug 23 '06 #6

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

Similar topics

3
2572
by: sparks | last post by:
I was copying fields from one table to another. IF the var name starts with milk I change it to egg and create it in the destination table. It works fine but I want to copy the description as well. Short version :) For Each fld In tdf.Fields pos = InStr(fld.Name, "milk") If pos > 0 Then
9
3676
by: Rakesh | last post by:
Hi, I am able to obtain a MenuItem object's Name property @ design-time, but am not able to get the same @ run- time...why? And since MenuItem doesn't inherit from Control class, it's not even supposed to be available @ design-time right?
13
4181
by: nyt | last post by:
I have a problem of number and text field. I got the database file(mdb) that contains many combo boxes used and its list values are created by "value list" For eg field Field name= 'furniture' , data type='Number' ,Display Control='Combo Box', RowSource Type = 'Value List' and Row Source = ' 0;"chair";1;"Table";2;"Bed" ' Therefore, in data sheet view of table, if we select (1 : Table ) ,
2
2208
by: garyusenet | last post by:
I could do with something similiar, can you tell me if you think this would work for me, and if there's any advantage in working with controls this way than how I currently am. At the moment i'm using the treenodes and each treenode needs a unique entry into my rich text box. After sitting at home with MSDN i've managed to get this functionality by storing a RTF string in the tag property of the treenode. On every 'before update' of the...
3
9487
by: steve | last post by:
Hi All How can I get the datagridview to redraw after changing the rowtemplate.height at runtime ( it is databound to a datatable) I have tried datagridview1.refresh etc to no avail (The row height stays the same) If I repopulate its datasource (datatable) then the rows resize OK, but that is an uneccessary overhead.
1
1830
by: murtyin | last post by:
Hi to All, I am creating COM Wrappers(CCW's) to the existing .Net Product, which is developed using C#. In this, am getting problem with setting "Item" propertty as the Default Property. My requirement is like this: I created 4 classess in CCW namely: PdfDocument, PdfForm,PdfFormField and PdfFormFieldList. to the respective .Net classess. Below, am giving the classess in brief. I configured my project for COM Interop . ...
11
7459
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
4
8718
by: Dean Slindee | last post by:
Anyone got a quick and easy way to change the background color on a textbox after the user has change the text value. Already have lots of forms written, so an approach that does not depend on adding code to an event on every textbox would be great. Just the same, I don't see an event specifically tailored for this task (like an OnChange event). Am I missing an obvious choice? Thanks, Dean S
5
1984
by: agarwasa2008 | last post by:
Hi, I have a linked table called tbltest and some bounded forms (which add, update, delete records) that were created using that linked table. For some necessary reasons I had to create another linked table called tblComponents and then I bounded the original forms to this new table. I did change the control source: Description (Field name) RowSource Type: Table/Query (which remains the same)
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.