|
-
Mar 27th, 2006, 11:20 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2005] Overide ToString of a Proeprty
Is it possible to override the ToString function of a property? What I have is a Property of an integer type, and throughout my code I need to convert the integer to Hex and if that hex value is only 1 digit add a zero at the begining. I would like to be able to just call ToString of the property instead of creating a function that I have to call everytime I need the conversion.
So say I have a value of 10
I convert that to Hex: A
I then check if A is 1 digit: It is.
I add 0 to the begining to make 0A.
I would like to just be able to say Property1.ToString and have the code to do this in the overriden ToString Function.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|