How to reach the (Name) property
-
Hello there! I've been strugling to find a way of obtaining the value of the (Name) property as a string at runtime (you know, the "label1" piece of text that you get when droping a label on your form). I need this to do some custom serialization for a component that doesn't implement any other identification property, and I can't seem to be able to do it. Before I go and extend the component to provide such a property (thus forcing everyone who uses it to type one in), anybody tried to get the (name) property or knows how to do it? Thanks in advance, Calin, Toronto
-
Hello there! I've been strugling to find a way of obtaining the value of the (Name) property as a string at runtime (you know, the "label1" piece of text that you get when droping a label on your form). I need this to do some custom serialization for a component that doesn't implement any other identification property, and I can't seem to be able to do it. Before I go and extend the component to provide such a property (thus forcing everyone who uses it to type one in), anybody tried to get the (name) property or knows how to do it? Thanks in advance, Calin, Toronto
If you drag and drop a button with the name button1, you can programmatically access its id or name by using the button1.Name property. It's not that difficult :-);P
-
If you drag and drop a button with the name button1, you can programmatically access its id or name by using the button1.Name property. It's not that difficult :-);P
Hi, Tahnoon, and thank you for your reply. As I said in my message, this involves a component (not a control). As we all know, the Name property is a property of the Control class, easily accessible for buttons, labels, etc. However, when you need to access that Name property on a class that doesn't inherit the Control class, thus does not implement the Name property, what do you do? Thank you again, Calin, Toronto