TextAttr property

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

Applies to



IWPAttrInterface TextAttr;



This property is used to change text attributes, such as font names, font sizes, colors and styles (bold, italic ...).


If not text is selected it changes the writing mode (see CurrAttr), otherwise the attributes of the selected text (see CurrSelAttr).


Please note that a click in the editor will reset the writing mode to the mode used by the text at the cursor position. If you change TextAttr in code you need to set the focus into the editor after the update of the current writing mode.

You can use this interface to create your own toolbar, in case you do not want to use the inbuilt toolbar to change the attributes of the text.

You can also use it to implement hotkeys, for example toggle 'bold' when pressing Ctrl+B.

Please also see important notice at Memo.TextAttr.


private void wpdllInt1_OnUpdateGUI(

 object Sender, 

 int Editor, 

 int UpdateFlags, 

 int StateFlags, 

 int PageNr, 

 int PageCount, 

 int LineNr)


         string n = "";

         wpdllInt1.Memo.TextAttr.GetFontface(ref n);

         FontCombo.Text = n;



[idh_wpdllint_textattr.htm]    Copyright © 2007 by WPCubed GmbH