StyleName Property

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

Applies to

IWPParInterface                                                workswithseltext


string StyleName;


The name of the paragraph style used by this paragraph. For paragraph styles, this is the name of the base style.


You can add a style using Memo.SelectStyle(name)


Example - inside the OnEnumParOrStyle event create and apply set a certain style


private void wpdllInt1_OnEnumParOrStyle(object Sender, 

  bool IsControlPar, int StartPos, int Count, 

  WPDynamic.IWPParInterface ParText, 

  WPDynamic.IWPAttrInterface ParAttr, 

  int EventParam, ref bool Abort)


     wpdllInt1.Memo.SelectStyle( new_style_name );

     wpdllInt1.Memo.CurrStyleAttr.SetFontSize( size_for_style );


     ParText.StyleName = s;

     Abort = false;



Please note that the attributes in a style are only used, if they are not overridden by the paragraph or character attributes. Here we use ClearCharAttr to make sure, the characters do not have their own attributes.


For a more selective control apply the style using ParStrCommand( 9, x, name ). If bit 1 is set in X, the character attributes, which are used by the selected style, are cleared, if bit 2 is set, the paragraph attributes are cleared.


Also see: "Paragraph Styles".


You need to call Memo.ReformatAll(true, true) after you have applied styles!


Paragraphstyle Support

[idh_iwpparinterface_stylename.htm]    Copyright © 2007 by WPCubed GmbH