Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.
« »

Using the IsCommonValueSelected property

Blogged by Björn Meyer on February 10, 2006 and tagged with Samples, .NET.

One of the least commonly used properties of the Selection class is IsCommonValueSelected. I have recently assisted several customers with this property and thus would like to take this opportunity to explain its exact functionality.

This property informs on whether a certain attribute has the same value as the value of the complete selection.

This is very important, for example, to synchronize a customized button bar with the current formatting of the selected text like bold or italic.

Possible attributes are:

  • Baseline: Specifies the attribute set through the Baseline property.
  • Bold: Specifies the attribute set through the Bold property.
  • FontName: Specifies the attribute set through the FontName property.
  • FontSize: Specifies the attribute set through the FontSize property.
  • ForeColor: Specifies the attribute set through the ForeColor property.
  • FormattingStyle: Specifies the attribute set through the FormattingStyle property.
  • Italic: Specifies the attribute set through the Italic property.
  • Strikeout: Specifies the attribute set through the Strikeout property.
  • TextBackColor: Specifies the attribute set through the TextBackColor property.
  • Underline: Specifies the attribute set through the Underline property.

The following VB.NET code return true, if the complete selection is formatted in bold.

Dim IsSelected As Boolean = TextControl1.Selection.IsCommonValueSelected(TXTextControl.Selection.Attribute.Bold)
« Prev:Modifying styles in TX Text Control ActiveX
» Next:ClickOnce deployment with TX Text Control .NET

top

Top 10 Bestselling Product Award 2007Top 25 Publisher Product Award 2007Top 10 Bestselling Product Award 2007 in JapanTop 25 Bestselling Product Award 2006Top 25 Bestselling Publisher Award 2006Reader's Choice Award, dot.net magazin, 3rd place