Picture

[property icon] Picture

Specifies the file name of the picture to be used as the forms background

Integer SYM index property

Applies to: Button , Form , Picture Button


[property icon] Picture

Specifies the toolbar picture for the menu item

Integer SYM index property

Applies to: MenuItem

Introduced in KCML version 5.03


[property icon] Picture

Specifies a picture for a cell

Integer SYM index property

Applies to: Grid , GridCell

Introduced in KCML version 5.02


[property icon] Picture$

String property


>Picture

Picture

This property allows a picture object to be assigned to a control that supports it (see list of controls supporting pictures). This property allows both stock pictures and pictures objects created within the forms designer to be assigned.

 .gridControl1.cell(row, col).Picture = &Information
 .picControl1.Picture = &Satellite

It can also be used to set the background picture of a form itself. Note that the PictureAlignment property is used to change the default position of the picture, for example:

 .form.Picture = &Satellite
 .form.PictureAlignment = &BottomLeft

An example KCML program you can paste into a KCML workbench session demonstrating the full list of stock pictures is available below:

Pictures in Menus

The picture property can be used to associate an image with a menu item. These images appear as a toolbar when the form is displayed and the toolbar buttons generate the same events as the corresponding menu items. Menu items that are disabled are displayed as disabled toolbar buttons, and menu items that are not visible have invisible toolbar buttons as well. The toolbar buttons have separators placed between items on separate pull-down menus. A large number of stock pictures are available including many for standard operations such as Open, Save, Cut, Copy and Paste. The mask color is gray meaning that any part of the picture that is grey will be drawn in the default button face color. On a standard windows setup this is also gray, but many users have their own preferences.

Two toolbar button sizes are supported. Large buttons are rendered at 24x24 pixels with the menu text and small buttons are rendered at 26x16 pixels and no text. To switch between large and small the forms COM method SetToolbarSize() can be used. The pictures themselves can be any resolution and are scaled automatically but they should be chosen to look good at these resolutions.

Any supported image format is allowed, e.g. .PNG, .JPG or .BMP, as well as Microsoft icon format .ICO files. Color depth is also flexible though KClient will attempt to render in 24 bit color and it will convert the image to 24 bit to do so.

Note that the picture properties must be set either at design time with the Forms Designer or dynamically during the Enter() event. The toolbar is created after the Enter() event but prior to the Show() event and does not change after that. The picture must be specified before the toolbar can be created.

In KCML 6.10 an option was added to the menu editor of KForm, labelled "First toolbar icon". Those menu items that have this option checked appear out of order on the toolbar menu as they always appear first. The intention here is for an Exit menu item which on a typcial form will appear as the last item on the first (usually called "File") menu. Normally this leaves the Exit toolbar icon after other icons, but by checking this option the Exit toolbar icon can be made to consistently appear first (and hence always in the same place) across all forms.

An example demonstrating a menu with a toolbar is available.

See also

Button methods, properties and events. Form methods, properties and events. Grid methods, properties and events. GridCell methods, properties and events. MenuItem methods, properties and events. Picture Button methods, properties and events.