• No results found

F ORM AND C ONTROL P ROPERTIES

In document Navision Bible (Page 130-133)

Designing Forms

7.1 F ORM AND C ONTROL P ROPERTIES

As described in Chapter 1 "C/SIDE Fundamentals", properties are a system-wide feature and every application object has some properties. Properties for forms and controls are edited by opening the Property Sheet in the Form Designer (by clicking View, Properties). As you select the form or a control in the form, the Property Sheet will display the properties for the selected object. The title bar of the Property Sheet window shows what kind of object (form, text box, label, and so forth) is currently selected. The first line of the sheet shows the ID if the object has one. Note that the Property Sheet can be scrolled vertically.

Each field on the Property Sheet contains a value that you can set by entering a value in the Value field on the Property Sheet. As soon as you leave the field (by pressing Enter or by using the arrow keys) the property is updated. If what you entered contains an error (for example, if you accidentally changed the ID of one control to be the same as that of another control), the update will not be accepted.

Default values are displayed in angle brackets (<>). If a property has a default, you can reset it to the default by deleting the current value and then moving out of the field.

Notice that some properties do not have defaults – mainly those that describe the position of the control within the form. These properties are constantly updated by C/SIDE when the control is moved.

How Properties Are Inherited

Controls that have a direct relationship to table fields will inherit the settings of those properties that are common to the field and the control. You can still change the settings of these properties for the control, but you cannot overrule the settings of certain field properties, namely those that concern data validation. For example, if the field property that determines which characters the user can enter is set to lowercase only, you cannot use the properties of the control to reset it to also accept uppercase characters. You can narrow the accepted range of characters but not broaden it. On the other hand, you can change properties like the caption– as this property has nothing to do with data validation.

When you design an application, you must consider whether these common

properties should be specified at the field level or at the control level. The advantage of using the lowest level (the field level) is that whenever the field is used as the data source of a control, these settings will be used as defaults. This ensures consistency.

7.1 Form and Control Properties

Form Properties

The table below briefly describes some of the more important form properties. All properties are described in detail in the online C/SIDE Reference Guide. You can get context-sensitive Help for a property by opening the Property Sheet for a form, placing the cursor on a property and pressing F1.

Property Name Use this property to...

ID set the numeric ID of the object. This property can also be set when you save a form. The ID must be unique among forms. Your C/SIDE dealer will inform you about the numbers you can use.

Name give the form a descriptive name. The name does not have to be unique, but you should give your forms unique names anyway, as they will be a lot easier to identify and find by name than by ID.

Minimizable specify whether the user can minimize the form window.

Maximizable specify whether the user can maximize the form window.

Sizeable specify whether the user can resize the form window.

SavePosAndSize specify whether information about the user-made changes to the size and placement of a form window will be saved. If it is set to Yes, this

information will be saved, and the next time the window is opened, these values will be used. Otherwise, the designed values will be used.

Editable specify whether the user is allowed to edit controls in the form. If it is set to No, no controls may be edited, even when their individual Editable properties are set to Yes.

InsertAllowed specify whether the form can be used to insert records in the database.

ModifyAllowed specify whether the form can be used to modify records in the database.

DeleteAllowed specify whether the form can be used to delete records from the database.

CalcFields specify a list of FlowFields that you want the system to calculate when the form is updated. If the FlowField is a direct source expression, it is automatically calculated. However, if it is indirect (part of an expression) it is not.

UpdateOnActivate specify whether you want the system to update the form when it is activated.

SourceTable specify the source table of the form. Normally, you will have specified the table when you first created the form. If you have created a form without an underlying table, however, you can enter a table name here to bind the form to a table.

SourceTableView create a view (what the user can see) of the source table for this form. You

General Properties for Controls

The table below briefly describes those properties that are common to several types of controls. All properties are described in detail in the online Reference Guide. You can get context-sensitive Help for a property by opening the Property Sheet for a form, selecting a control, placing the cursor on a property and pressing F1.

Property Name Use This Property to...

ID set the numeric ID of the control. The system assigns a sequential number by default. If, however, you delete a control, and then add another in its place, you may want to give the newly created control the number of the one you deleted. The ID must be unique among controls and menu items on the form.

Name give the control a descriptive name.

Caption specify the text that the system displays for this control.

HorzGlue to anchor a control horizontally on the form. You can choose Left, Right or Both. If you choose Both, the control will be resized when the form is resized.

VertGlue to anchor a control vertically on the form. You can choose Top, Bottom or Both. If you choose Both, the control will be resized when the form is resized.

Visible specify whether the control will be visible when the form is opened. This property can be changed from C/AL at runtime.

Notice that if the control is a child control and the parent has Visible = No, the child will not be visible, even if it has Visible = Yes.

ParentControl specify the ID of a parent control, thereby turning the control into a child.

In document Navision Bible (Page 130-133)