Why is the control inaccessible due to its protection level?

前端 未结 4 1357
时光说笑
时光说笑 2020-12-11 00:50

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条回答
  •  不思量自难忘°
    2020-12-11 01:14

    This is the default property for controls and can be solved by:

    1. Going into Design-View for the Form that contains the specified Control
    2. Then changing the Control's Modifiers property to Public or Internal.

提交回复
热议问题