Back to Devexpress

CharacterPropertiesBase.Language Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-characterpropertiesbase-687ab6bc.md

latest2.9 KB
Original Source

CharacterPropertiesBase.Language Property

Specifies the spell check and hyphenation language.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
LangInfo? Language { get; set; }
vb
Property Language As LangInfo?

Property Value

TypeDescription
Nullable<DevExpress.XtraRichEdit.Model.LangInfo>

A nullable Nullable<T><DevExpress.XtraRichEdit.Model.LangInfo,> value.

|

Remarks

The LangInfo structure specifies languages used to check spelling, grammar (if requested), and hyphenation when processing the text run. The text run can contain text of three different cultures. The LangInfo has the following constructor:

csharp
public LangInfo(CultureInfo latin, CultureInfo bidi, CultureInfo eastAsia)
vb
New(ByVal latin As CultureInfo, ByVal bidi As CultureInfo, ByVal eastAsia As CultureInfo)

The SpellChecker checks the text’s spelling according to the specified parameters.

The code sample below specifies the selected text’s language:

csharp
DocumentRange targetRange = richEditControl1.Document.Paragraphs[2].Range;
CharacterProperties cp = richEditControl1.Document.BeginUpdateCharacters(targetRange);
cp.Language = new DevExpress.XtraRichEdit.Model.LangInfo
    (new System.Globalization.CultureInfo("en-US"), new System.Globalization.CultureInfo("ar-SA"), new System.Globalization.CultureInfo("en-US"));
richEditControl1.Document.EndUpdateCharacters(cp);
vb
Dim targetRange As DocumentRange = richEditControl1.Document.Paragraphs(2).Range
Dim cp As CharacterProperties = richEditControl1.Document.BeginUpdateCharacters(targetRange)
cp.Language = New DevExpress.XtraRichEdit.Model.LangInfo
  (New System.Globalization.CultureInfo("EN-US"), New System.Globalization.CultureInfo("ar-SA"), New System.Globalization.CultureInfo("EN-US"))
richEditControl1.Document.EndUpdateCharacters(cp)

See Also

CharacterPropertiesBase Interface

CharacterPropertiesBase Members

DevExpress.XtraRichEdit.API.Native Namespace