views:

303

answers:

1

I'm trying to access a control's text property from program.cs and it says that it is inaccessible due to protected level. How can I fix this please?

+4  A: 

This is the default property for controls, and can be solved by going into Design-View for the Form that contains the specified Control, then changing the Control's Modifiers property to Public or Internal. That oughta do it! :)

baeltazor
Note: just to emphasize as this seems to have been very unclear by the asker, this is the *control's instance itself* that's protected (i.e., the variable holding the control), not the *`.Text` property*, which is public.
Abel
thank you Abel .
baeltazor