Collection of predefined properties which can be applied to all items at once.
It holds properties which effect physical appearance like color, font etc.
Types of Visual Attributes
Common Attribute -- Applicable to all items in a block.
Prompt Attribute Applicable to prompts. ( Text before controls )
Title Attribute Applicable to frame title only.
Creating Visual Attribute
Open existing form EMP_FORM.fmb
In Object navigator ( F3 ) Select Visual Attribute Click on create button.
In the property palette, provide the following properties General
Name VA1 Color
Foreground color Red
Background color Blue Font
Font Name Arial
Font size 10
Font style Underline
Now, Assign the visual attribute to the items.
Go to Layout editor ( F2 ),
Select all the items ( Ctrl + A ) Point your cursor on ename field property palette Visual Attributes
Visual Attribute group VA1
Save.
Program Compile module
Program Run Form
Click on execute query
Observe, the properties which we have applied to visual attribute group, is assigned in all the items at once easily. That is the advantage of visual attributes.
Note
The default visual attribute type is common.
Example of prompt visual attribute
Open existing form EMP_FORM.fmb
In Object navigator ( F3 ) Select Visual Attribute Click on create button.
In the property palette, provide the following properties General
Name PVA1
Visual Attribute type Prompt
Prompt Color
Prompt foreground color White
Prompt font
Prompt font name Tahoma
Prompt font size 14
Prompt font style Italic
Now, Assign the prompt visual attribute to Items.
Goo to object navigator ( F3)
In Data block EMP select multiple items ( 4 items) using shift key ( Empno, Ename , job, Mgr)
Bu holing shift key right click property palette Visual Attributes Prompt Visual Attribute group PVA1
Save.
Program Compile Module
Program Run Form
Observe, Prompt visual attribute group, is applicable only for prompt.
Example of Title visual attribute group
Open existing form EMP_FORM.fmb
In Object navigator ( F3 ) Select Visual Attribute Click on create button.
In the property palette, provide the following properties
General
Name TVA1
Visual Attribute type Title
Frame title color
Frame title foreground color yellow
Title font
Frame title font name Book Antiqua
Frame title font size 18
Frame title font style Italic
Now, we need to assign title visual attribute to the frame
In Object navigator Canvas graphics Frame property palettle Visual Attributes Frame title visual attribute group TVA1
Save.
Program Compile Module
Program Run form
Observe, the properties are applicable to frame title.