combit List & Label 30 - .NET Help
combit.Reporting Namespace / ListLabel Class / ProcessText Event


ProcessText Event

This event is called whenever text is printed. Use it for preprocessing, e.g. hyphenation.

Syntax
'Declaration
 
Public Event ProcessText As EventHandler(Of ProcessTextEventArgs)
 
Event Data

The event handler receives an argument of type ProcessTextEventArgs containing data related to this event. The following ProcessTextEventArgs properties provide information specific to this event.

PropertyDescription

The name of the object currently printing.

 

The subtype of the object e.g. for extension objects.

 

The type of the object.

 

The actual text that may be modified.

 

The text type.

 
Example

The following sample shows the use of hyphenation with the external component NHunspell which exists as NuGet package.

NHunspell.Hyphen _hyphen = new NHunspell.Hyphen(@"c:\users\public\hyph_en_us.dic");
char _conditionalSeperator = (char)173;

private void LL_ProcessText(object sender, ProcessTextEventArgs e)
{
    NHunspell.HyphenResult hyphenated = _hyphen.Hyphenate(e.Text);
   
    if (hyphenated != null)
        e.Text = hyphenated.HyphenatedWord.Replace('=', _conditionalSeperator);
}
Requirements

Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
.NET: .NET Framework 4.8, .NET 6, .NET 8, .NET 9

See Also