InputString Method |
[Top] [Chapter] [Previous] [Next] |
Applies to Declaration procedure InputString(const Text: WideString; CharAttrIndex: Integer); Description Inserts a string at cursor position
Tip: To read the character at the current position use Memo.CurrPar.GetChar(Memo.TextCursor.CPPosInPar)
Example: // We need this interfaces for text creation IWPMemo Memo = WPDLLInt1.Memo; IWPTextCursor TextCursor = Memo.TextCursor; IWPAttrInterface AttrHelper = WPDLLInt1.AttrHelper;
// Calculate a character style index value AttrHelper.Clear(); AttrHelper.SetFontface("Times New Roman"); AttrHelper.SetFontSize(11); AttrHelper.IncludeStyles(2); // Italic int mycharattr = AttrHelper.CharAttrIndex;
// and insert some text TextCursor.InputString("Hello World", mycharattr); |