Explain how to create a read-only or write-only property - DOT.NET

Explain how to create a read-only or write-only property.

You can either use fields or property procedure to add properties.

To create a property that can only be read and not altered, you need to declare it as ReadOnly. After doing this, if you try to assign value to the property, an error will occur.
The next step is to write a get procedure to retrieve the value contained by the variable.
Nb: The set procedure should not be written in this case.

To create a WriteOnly property like in case of passwords, you need to declare it as WriteOnly. Then, this value cannot be used for reading purposes. After the declaration, you need to write only a set procedure without writing a get to be able to just set the value of the variable
Describe .NET form - DOT.NET
Forms provide a User Interface (UI) to give the applications a look and feel. Forms provide properties, methods, and events for the controls they contain...
What are Form properties? - DOT.NET
The common properties that all of the controls on form have are: Font, ForeColor, Modifiers, TabIndex....
What are Form methods that control its lifecycle? - DOT.NET
First a form object is created using the constructor. The form is then loaded and then its layout is initialized....
Post your comment