Reputation: 1095
I have a parent form and a child form that inherits from the former. In design mode all the inherited controls' properties are disabled. How can I change these properties in the child form?
Here is a screenshot of the designer. Note how I have selected a text box and all its properties are disabled (greyed out).
Upvotes: 3
Views: 2416
Reputation: 6813
By default, the Windows Forms designer creates components with the private
access modifier. This means that an inheriting form will render the controls, but cannot modify them.
To fix this, open the base form in the designer. Select the control(s) that you want to be able to modify and change the Modifiers
property to Protected
.
Important: After this change, you must rebuild the base form's project for changes to show up in the inheriting form's designer view.
Upvotes: 4