|
The name of a property is represented on the left column. This is the
official name of the property. The names of properties are in
one word. You can use this same name to access the property in code.
The box on the right side of each property name represents the value of
the property that you can set for an object. There are various kinds of
fields you will use to set the properties. To know what particular kind a
field is, you can click its name. To set or change a property, you use
the box on the right side of the property’s name: the property's value,
also referred to as the field's value.
|
Practical
Learning: Displaying the Properties Window
|
|
- To display the Properties windows, on the main menu, click View ->
Properties Window
 |
By default, these fields have nothing in their value section. Most of these properties are dependent on other settings of your program. For example, you can set a menu property for a form only after you have created a menu.
To set the property on such a field, you can type in it or select from a list.
|
|
Practical
Learning: Checking Empty Fields
|
|
- Click the body of the form.
In the Properties windows, notice that the AccessibleName and the Tag fields
are empty
There are fields that expect you to type a value. Most of these fields have a default value.
Here is an example:

To change the value of the property, click the name of the property,
type the desired value, and press Enter.
While some properties, such as the
Text, would allow anything, some other fields expect a specific type of text, such as a
numeric value.
|
Practical
Learning: Checking Text Fields
|
|
- In the Properties windows, click Text and notice that it contains a string
in bold characters
- Click (Name) and notice that it contains some bold characters
Some fields expect a numeric value. In this case, you can
click the name of the field and type the desired value. Here is an example:

. If you type an invalid
value, you would receive a message box notifying you of the error:
When this happens, click OK and type a valid value. If the
value is supposed to be an integer, make sure you don't type it as a decimal
number.
|
Practical
Learning: Checking Numeric Fields
|
|
- In the Common Controls section of the Toolbox, click NumericUpDown and
click the form
- While the control is still selected on the form, in the Properties
windows, click Value and notice that it contains a number string in bold
characters
- Click the DecimalPlaces, the Increment, the Maximum, and the Minimum
fields to see that they contain numeric values:

Some fields expect you to enter a date. You must type a
valid date recognized by the operating system and the Regional and Language
Settings in Control Panel. If you enter an invalid date, you would receive an
error.
|
Practical
Learning: Checking Date and Time Fields
|
|
- In the Common Controls section of the Toolbox, click DateTimePicker and
click the form
- While the control is still selected on the form, in the Properties
windows, click Value and notice that it contains a date and time value
- Click the MinDate and the MaxDate fields to see their values:

 |
Some fields have a + button. This indicates that the
property has a set of sub-properties that actually belong to the same
property and are defined together. To expand such a field, click its + button
and a – button will appear: |
 |
To collapse the field, click the – button.
Some of the properties are
numeric based, such as the Location or the Size. With such a property, you can click
its name and type two numeric values separated by a comma. Some other
properties are created from an enumeration or a class. If you expand such a
field, it would display various options. Here is an example from the Font
property:
With such a property, you should select from a list.
|
Practical
Learning: Checking Expandable Fields
|
|
- Click an empty area of the form to select the form
- In the Properties window, click the + button of the Font field to expand
it and notice that it display some previously hidden items
 |
Some fields can have only a True or False value. To change their setting, you can either select from the combo box or double-click the property to toggle to the other value. |
|
Practical
Learning: Checking Boolean Fields
|
|
- In the Properties window click Enabled and notice that it displays True
- Under Font, click Bold and notice that it displays False
Some fields would require a value or item that needs to be
set through an intermediary action. Such fields display an ellipsis button
. When you click the button, a dialog box would come up and you can set the value for the field.
|
 |
|
Practical
Learning: Checking Action Fields
|
|
- In the Common Controls section of the Toolbox, click PictureBox and click
the form
- While the control is still selected on the form, in the Properties
windows, click Image and notice that the field displays an ellipsis button

- Click the ellipsis button and notice that a dialog box comes up
- Click Cancel
To change the value of some of the fields, you would use their combo
box to display the available values. After clicking the arrow, a list would display:
There are various types of list-based fields. Some of them display just
two items. To change their value, you can just double-click the field. Some other fields have
more than two values in the field. To change them, you can click their arrow and select from
the list. You can also double-click a few times until the desired value is selected.
|
Practical
Learning: Checking List-based Fields
|
|
- Click an empty area of the form to select the form
- In the Properties window, click FormBorderStyle and notice that it
displays an arrow button of a combo box
- Press Alt and the down arrow key to display the list
- Press Esc
Some properties provide a window from where you can select
the desired option. The field primarily displays the arrow of a combo box. To
use the field, you click the arrow of the combo box and the window appears. Here
are examples:
After expanding the window, you can select the desired
option. We will eventually review them.
|
Practical
Learning: Checking
Area-Selection Fields
|
|
- On the form, click one of the controls
- In the Properties window, click Dock and click the arrow of its combo box
- Notice the window that comes up and press Esc
|
|