HeaderFooter Class | ||
An instance of the HeaderFooter class represents a header or footer in a Text Control document. A header or footer can be obtained through the TextControl.HeadersAndFooters or through the Section.HeadersAndFooters property. The collection obtained through the TextControl.HeadersAndFooters property contains headers and footers which are common to all sections of the document. If a header or footer is added to this collection all sections of the document have the same header or footer. These headers and footers are connected, which means that changing the contents of such a header or footer also changes the content of all other section's headers or footers. The HeaderFooter.ConnectedToPrevious property of these headers and footers is set to true. The collection obtained through theSection.HeadersAndFooters property contains headers and footers which are single to this section. Changing the contents of such a header or footer does not change the contents of other headers and footers. The TextControl class has events that inform about different occurrences like activation or deactivation of a header or footer. | ||
| Syntax: | [C#]
public class HeaderFooter
[Visual Basic]
Public Class HeaderFooter
| |
Properties | ||
| Property | Description | |
| ApplicationFields | Gets a collection of all Microsoft Word or Heiler HighEdit fields that have been created or imported from a Microsoft Word or RTF document. | |
| ConnectedToPrevious | Gets or sets a value specifying whether the header or footer is connected with the header or footer of the previous section. If headers or footers are connected, they have always the same contents. | |
| Distance | Gets or sets the distance, in twips, of a header or footer to the top or bottom of the page. | |
| Images | Gets a collection of all images the header or footer contains. | |
| Lines | Gets a collection of all text lines the header or footer contains. | |
| PageNumberFields | Gets a collection of page number fields in the header or footer. | |
| Paragraphs | Gets a collection of all paragraphs the header or footer contains. | |
| SectionNumber | Returns the number of the section to which the header or footer belongs. | |
| Selection | Gets or sets the current selection in a header or footer. | |
| Tables | Gets a collection of all tables in the header or footer. | |
| TextChars | Gets a collection of all characters the header or footer contains. | |
| TextFields | Gets a collection of all standard text fields in the header or footer. | |
| TextFrames | Gets a collection of all text frames contained in a header or footer. | |
| Type | Gets the type of the header or footer. | |
Methods | ||
| Method | Description | |
| Activate | Activates a header or a footer. | |
| Deactivate | Deactivates a header or a footer. | |
| Example: | The following example shows how to insert a header to the first section.[C#]
textControl1.ViewMode = TXTextControl.ViewMode.PageView;
textControl1.Sections[1].HeadersAndFooters.Add(TXTextControl.HeaderFooterType.Header);
TXTextControl.HeaderFooter header = textControl1.Sections[1].HeadersAndFooters.GetItem(
TXTextControl.HeaderFooterType.Header);
header.Selection.Text = "TX Text Control";
header.Selection.Start = 3;
header.Selection.Length = 4;
header.Selection.Bold = true;
[Visual Basic]
TextControl1.ViewMode = TXTextControl.ViewMode.PageView
TextControl1.Sections(1).HeadersAndFooters.Add(TXTextControl.HeaderFooterType.Header)
Dim header As TXTextControl.HeaderFooter = TextControl1.Sections(1).HeadersAndFooters.GetItem( _
TXTextControl.HeaderFooterType.Header)
header.Selection.Text = "TX Text Control"
header.Selection.Start = 3
header.Selection.Length = 4
header.Selection.Bold = True
| |
| See also: | Headers and Footers, Graphical Overview. | |