What should you do to ensure that the read-only properties are not displayed in the Properties window?

You are creating a Windows Forms application. Your application uses a custom control. The Custom control is based on a standard button control. You add several extra properties to the control. Some of these properties are read-only. You need to ensure that the read-only properties are not displayed in the Properties window of the design environment. What should you do?

You are creating a Windows Forms application. Your application uses a custom control. The Custom control is based on a standard button control. You add several extra properties to the control. Some of these properties are read-only. You need to ensure that the read-only properties are not displayed in the Properties window of the design environment. What should you do?

A.
Decorate the read-only properties by using the EditorBrowsable attribute, and then set the EditorBrowsable attribute to EditorBrowsableState.Never.

B.
Use the DesignTimeVisible attribute,
and then set the DesignTimeVisible attribute to False.

C.
Decorate the read-only properties by using the Browsable attribute, and then set the Browsable attribute to False.

D.
Decorate the read-only properties by using the DisplayName attribute, and then set the DisplayName attribute to null.



Leave a Reply 0

Your email address will not be published. Required fields are marked *