Messenger Plus! Live - Scripting Documentation
The PlusWnd::RichEdit_SetCharFormat function changes the
formatting attributes of the characters in a
RichEditControl. The change can be applied on a
selection or on the whole text of the control.
Syntax
RichEdit_SetCharFormat(
[string] ControlId,
[boolean] SetOnSel,
[number] Bold,
[number] Italic,
[number] Underline,
[number] Strikeout,
[number] Height,
[number] TextColor,
[string] FaceName
);
Parameters
- ControlId
- [string] Unique identifier of the control.
- SetOnSel
- [boolean] If this parameter is true, the new attributes are
set to the current selection. If it is false, the new attributes
are set on the whole text of the control. See remarks.
- Bold
- [number] 1 to set bold, 0 to remove bold, -1 to ignore this
parameter.
- Italic
- [number] 1 to set italic, 0 to remove
italic, -1 to ignore this
parameter.
- Underline
- [number] 1 to set underline, 0 to remove
underline, -1 to ignore this
parameter.
- Strikeout
- [number] 1 to set strikeout, 0 to remove
strikeout, -1 to ignore this
parameter.
- Height
- [number] Size of the text in device units, -1 to ignore this
parameter.
- TextColor
- [number] Color of the text, in RGB format (0x00bbggrr), -1 to ignore this
parameter.
- FaceName
- [string] Font name, set to an empty string to ignore this
parameter.
Return Value
No value is returned by this function.
This function typically fails for the following reason:
- FaceName has a length bigger than 31 characters.
- The PlusWnd object refers to a window that has been destroyed.
Remarks
This function can only be used with a
RichEditControl, it has no effect on an
EditControl.
To change the
formatting of a portion of text only (when SetOnSel is true),
the control's XML attributes must specify "Rich Text" for <TextMode>.
If it isn't specified, the function fails silently.
Function Information
Object |
PlusWnd |
Availability |
Messenger Plus! Live 4.21 |
See Also
PlusWnd Object, EditBox_SetCurSel.