How To access inner Control in custom user control
-
i creat custom control that have a lable. how can i expose all property of this lable for cotrol consumer
-
i creat custom control that have a lable. how can i expose all property of this lable for cotrol consumer
-
Bad idea! You should not expose controls directly - it locks your control format so you cannot make any changes without risking breaking external code that uses the controls in ways you did not anticipate, and also constrains you to always use that control in future, even if you should "replace that text box with a drop down list and a numeric up-down because that reflects better what the data is used for". If you did, you would break outside code and potentially annoy a lot of people whose code relies on yours. Instead, use a public property to get and set the value on your internal, hidden controls - that is why all controls default to private when you add them in the designer!
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
-
i creat custom control that have a lable. how can i expose all property of this lable for cotrol consumer
Please do not post the same question in two places - here and QA. It duplicates work and can annoy people.
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
-
i creat custom control that have a lable. how can i expose all property of this lable for cotrol consumer
The way I would do it is I would wrap each property in a custom property that merely called the underlying property.
Chill _Maxxx_
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier -
tnx.good idead
-
tnx.good idea
-
tnx.good idead
No, it is not a good idea - it is a very bad idea. Remember your OOPs concepts - this breaks them (pretty much all of them) and makes future development and maintenance much harder. Just because you can do something, doesn't mean you should.
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.