Dan Neely Dan Neely - 1 month ago 12
C# Question

Change default access modifier for controls created in UI designer

I'm creating winforms using visual inheritance. In order to be able to manipulate inherited UI controls in child classes I need to set the controls in the base classes to

protected
accessibility instead of
private
. I can do this manually, but would like to be able to change the default behavior for the solution I'm working on. Is this possible>

Answer

Working with WinForms for a couple of years, but without knowing everything that is possible (who can?), what you want to achieve is not possible. You'll have to do it manually. For my own purpose, how would you want it to be feasible? Which kind of options are you expecting that will help you achieve your goal that is really application specifics. Do you want the possibility to set all the controls on a form with protected access modifier? If it is the case, I think that we should discuss more about design. If not, then you'll have to set them manually.

Comments