InputTextbox Method

[Top]  [Chapter]  [Previous]  [Next]

Applies to

IWPTextCursor

Declaration

int InputTextbox(int Width, string Text);

Description

Creates a text box. If no text was specified the cursor will be placed within the text object layer. You can use InputText to add more text. This feature requires the "premium" license, it is always available in RTF2PDF.

 

After the insertion of the text box you can set the relative location using

       Memo.CurrObj.RelX = twips value;

       Memo.CurrObj.RelY = twips value;

Please note that after GotoBody the interface CurrObj cannot be used anymore.

 

Parameters:

Width : The Width of the box in twips. The height is always determined by the contained text.

Text : The initialization text - may contain HTML or RTF tags. To create an empty box use "CLEAR". If no text was specified (except "CLEAR") the cursor will be places inside the new text box. You can fill in text and then call GotoBody when you are done.

Returns

0 if not successful. Otherwise the interface CurrObj can be used to change object properties.

Example:

 

text_box

 

  TextCursor.InputTextbox(2880"");

  // Save writing mode, then enter some text

  int save_ch = Memo.CurrAttr.CharAttrIndex;

  Memo.CurrAttr.SetFontSize(8);

  for (int i = 0; i < 10; i++)

  TextCursor.InputText("text box with wrapped text ");

  Memo.CurrPar.Alignment = 3;  // justified text

  Memo.CurrObj.RelX = 3500;

  Memo.CurrObj.RelY = 720;

  Memo.CurrObj.Wrap = 4;

  TextCursor.GotoBody();

  Memo.CurrAttr.CharAttrIndex = save_ch;

  Memo.CurrPar.Alignment = 3;

  for (int i = 0; i < 30; i++)

  TextCursor.InputText("some wrapped text ");

 

 

 

 

 


[idh_iwptextcursor_inputtextbox.htm]    Copyright © 2007 by WPCubed GmbH