473,386 Members | 1,793 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,386 software developers and data experts.

Custom Property

I'm trying to create a class and with in that class i want to access or
change the property statement by using "For" or "For each..." statement... is
this possible?

Please point me to the right direction if it is possible.

Please advice.
Thanks in advance.
Ros
Jan 17 '06 #1
5 917
I'm trying to create a class and with in that class i want to access or
change the property statement
Which property statement? Can you post the code you have so far?

by using "For" or "For each..." statement... is
this possible?


If the property returns something that can be iterated over you can do
that, yes.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 17 '06 #2
not the property itself...

i ment each individual property in a class... i looked at CollectionBase
Class, but i was not sure if it would return the property... write the
following statements

for each property in MyCollection
'rest of the codes here
next

"Mattias Sjögren" wrote:
I'm trying to create a class and with in that class i want to access or
change the property statement


Which property statement? Can you post the code you have so far?

by using "For" or "For each..." statement... is
this possible?


If the property returns something that can be iterated over you can do
that, yes.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Jan 17 '06 #3
>i ment each individual property in a class... i looked at CollectionBase
Class, but i was not sure if it would return the property... write the
following statements

for each property in MyCollection
'rest of the codes here
next

I'm still not sure I fully understand what you're trying to do, but I
think you may be looking for reflection.

For Each pi As PropertyInfo In GetType().GetProperties()

Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 17 '06 #4
thanks for the advice Mattias, i'll try that.
Thanks again.

Ros

"Mattias Sjögren" wrote:
i ment each individual property in a class... i looked at CollectionBase
Class, but i was not sure if it would return the property... write the
following statements

for each property in MyCollection
'rest of the codes here
next

I'm still not sure I fully understand what you're trying to do, but I
think you may be looking for reflection.

For Each pi As PropertyInfo In GetType().GetProperties()

Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Jan 17 '06 #5
Thank you Mattias, that helped me too :)

Cheers!
Cyril
Jan 18 '06 #6

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

Similar topics

4
by: Rudy | last post by:
Hello all, I'm sure there is, just can't figure it out. I have the RGB code and the color number. But the color doesn't exsist in Visual studio.net. Can I add this color to the system pallet it...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
6
by: Steve Amey | last post by:
Hi all I want to be able to throw a custom error up the call stack. I have looked around and it seems as though it's possible, but I can't get it to work :o( Below is some sample code. ...
3
by: | last post by:
Hi all, I have a question on reflection Lets say I have a custom object called Address. Now, lets say I have a string variable that holds the name of a variable in the object such as...
3
by: Dan | last post by:
Hi all! When I throw my custom Exception class the first time in my code, the compiler takes a lot of time for find the following catch EX: try Throw New MyCustomException("test")
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
13
by: Matt F | last post by:
I have a deployment project that I'm setting up. I need to perform a different custom action based on whether this is a first time install or an update. Does anyone have any idea if it's possible...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.