rvico TRichView Reference | TRichView

TCustomRichView.SetControlInfo

Top  Previous  Next

Changes main properties of the item of control type.

function SetControlInfo(ItemNo: Integer; const AName: TRVAnsiString;

  AVAlign: TRVVAlignconst ATag: TRVTag): Boolean;

Parameters:

ItemNo – index of the item. The item must be of control type (rvsComponent), otherwise the method raises ERichViewError exception. Items are indexed from 0 to ItemCount-1, GetItemStyle returns type of item. Items of subdocuments (table cells) are not included in the items range of the main document; for items in cells, use Cell.GetRVData.SetControlInfo.

AName – name of the item, any string without line break (CR, LF) characters. It can also be set using SetItemText method. This is not a Name property of the control!

AVAlign – vertical alignment of this item, see TRVVAlign for possible options.

ATag tag of the item. Do not confuse with Tag property of the control! You can use value returned by GetControlInfo or GetItemTag for this item. The tag can also be set by SetItemTag method.

 

Return value: "is reformatting needed? (i.e., is the new vertical align not equal to the old one?)"

 

Method type: viewerstyle viewer-style.

Additional item properties are assigned by the methods SetItemExtraIntProperty and SetItemExtraStrProperty.

unicode Unicode note: names of non-text items are ANSI strings.

Note: As you can see, current version of TRichView does not allow to change the control itself.

 

Example

RichView1.SetControlInfo(ItemNo, 'my control', rvvaBaseline, 'control tag');

 

See also methods:

GetControlInfo;

GetItemStyle;

Format;

SetItemExtraIntProperty;

SetItemExtraStrProperty.

See also properties:

ItemCount.

See also methods of RichViewEdit:

SetControlInfoEd;

SetCurrentControlInfo.

See also:

Modifying RichView items;

Item types;

Tags.


TRichView © trichview.com