combit List & Label 25 - .NET Online Web Help
ProcessText Event

combit.ListLabel25 Namespace > ListLabel Class : ProcessText Event

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

Public Event ProcessText As EventHandler(Of ProcessTextEventArgs)
public event EventHandler<ProcessTextEventArgs> ProcessText
event EventHandler<ProcessTextEventArgs^>^ ProcessText
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.


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.


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);
Private _hyphen As NHunspell.Hyphen = New NHunspell.Hyphen("c:\users\public\hyph_en_us.dic")
Private _conditionalSeperator As Char = ChrW(173)

Private Sub LL_ProcessText(ByVal sender As Object, ByVal e As ProcessTextEventArgs)

    Dim hyphenated As NHunspell.HyphenResult = _hyphen.Hyphenate(e.Text)

    If hyphenated IsNot Nothing Then
        e.Text = hyphenated.HyphenatedWord.Replace("="c, _conditionalSeperator)
End Sub

Platforms: Windows 7 SP1 to Windows 10 Version 1709 - 1909, Windows Server 2008 R2 to 2019

See Also