FindByKey(Key: Integer): IStyleContainer;
Key is a key of the style container, by which the search is executed.
The FindByKey method searches by key and returns the style container from the styles table. The key, by which the search is executed, is passed by the Key parameter.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
StyleSheet: IStyleSheet;
Style: IStyleContainer;
TabSty: ITabCellStyle;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Global_Style").Edit;
StyleSheet := MObj As IStyleSheet;
Style := StyleSheet.FindByKey(4);
If Style <> Null Then
TabSty := New TabCellStyle.Create;
TabSty.LoadFromContainer(Style);
TabSty.Font.Size := TabSty.Font.Size * 2;
TabSty.SaveToContainer(Style);
End If;
MObj.Save;
End Sub Main;
After executing the example the style container with the 4 key is searched. If the search is successful, the font for the style stored in this container is increased two times.
See also: