IFormControl.Resources

Syntax

Resources: IResourceObject;

Description

The Resources property determines the object-resources, from which the new text and graphic values are taken for the components of the form.

Comments

The value of the Resources property can be set by several ways:

Determination of the object-resources in the development mode enables the user to set the text values stored in the resources for all visual components of the form.

After connection of the object-resources to the form, the ResourcesID additional attribute is added to the values of the text type in the Object Inspector for all visual components.

The value of this attribute is formed automatically and it consists of the name of the component that contains object and name of the object separated by points.

Click the button in the ResourcesID field and select the value in the dialog box that opens or input the identifier of the resources element directly in the field to compare the text property of the visual component with the line element of the resources.

After the form startup, the values from the object-resources in accordance with the default language set for the repository should be represented as the text values for the components. Graphic values are set using the Fore language.

Example

Executing the example requires a form, a button with the Button1 identifier on it, the Label component with the Label1 identifier and the ImageBox component with the ImageBox1 identifier.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Begin

Self.Resources := MetabaseClass.Active.ItemById("RESOURCE_1").Bind As IResourceObject;

Label1.Text := Resources.Strings.Value("Id_1");

ImageBox1.LoadImageFromStream(Resources.Binaries.Value("Image_1"));

End Sub Button1OnClick;

After executing the example on clicking the button, the object with the RESOURCE_1 identifier is set as a data source of resources for the form, the text is loaded from the line with the Id_1 identifier in the Label1 component, the image is loaded from the line with the Image_1 identifier in the ImageBox1 component. The text and image are loaded in accordance with the default language set for the repository.

See also:

IFormControl