AddUndoUnit Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Adds the current state of the header or footer to the undo stack. Programmatic changes performed with the header's or footer's properties and methods are not automatically added to a TextControl's undo stack. Calling this method is not necessary, when the header's or footer's text and/or formatting is changed.
Syntax
public void AddUndoUnit();Public Sub AddUndoUnit()Examples
The following example creates a header for the first section and configures its content or layout by using HeaderFooter.AddUndoUnit.
HeaderFooterCollection headers = textControl.Sections[1].HeadersAndFooters;
headers.Add(HeaderFooterType.Header);
HeaderFooter headerFooter = headers.GetItem(HeaderFooterType.Header);
headerFooter.Selection.Text = "Quarterly report";
headerFooter.AddUndoUnit();
Console.WriteLine("Header Footer is ready for use.");Dim headers As HeaderFooterCollection = textControl.Sections(1).HeadersAndFooters
headers.Add(HeaderFooterType.Header)
Dim headerFooter As HeaderFooter = headers.GetItem(HeaderFooterType.Header)
headerFooter.Selection.Text = "Quarterly report"
headerFooter.AddUndoUnit()
Console.WriteLine("Header Footer is ready for use.")