|
Hi,
I apologize in advance for asking a question I'm sure has been answered time and time again, but I cannot for the life of me find the answer, here or anywhere in the Interwebs.
I want to inherit a control, say a button. That particular button's text should be "Save" by default. How do I make that happen?
What I originally did was simply set the Text as "Save" in the constructor of my inherited control. My problem is that when I add this inherited control to a form, the designer sets that new button's text to the default value "SaveButton1" which is the name of the class, anda number added to it for uniqueness.
I thought of overriding the Text property and disable the setting by simply ignoring the provided value, but I don't find that to be a very clean solution. A clean solution would be to make the setter private, but I also do not know how to change the access level of an inherited property to Private. Is that even possible?
Thank you. |