Headers and Footers
Headers and footers repeat on every page of a section: a letterhead, a report title, "Page 3 of 12". In a Windows Forms TextControl, users add them from the ribbon or the Page Setup dialog box and type into them after activating them with the mouse. Your code adds them, fills them with text and page numbers, decides how they're activated and follows the user between header, footer and main text.
The examples are methods of Form1.cs in the application from Create Your First Windows Forms Application, called from the Click handler of a button. A section is a part of a document with its own page settings, which Sections and Page Layout introduces. For headers and footers added without a user interface, see Sections, Pages, Headers, and Footers.
Put Images and Other Content Into a Header
A header has the same collections as the main text: HeaderFooter.Images takes a logo, HeaderFooter.Tables a table and HeaderFooter.Barcodes a barcode, with the same Add methods as in Images and Charts and Barcodes. An image in a header that lies behind the text appears on every page of the section, like a watermark. The blog article Merging Multiple Records with First-Page Headers and Footers combines first page headers with a mail merge.
Next Steps
- Sections and Page Layout: give a section its own page settings and headers.
- Fields, Hyperlinks, and Bookmarks: the other fields of a document.
- Footnotes: notes at the bottom of the page.
- Sections, Pages, Headers, and Footers: headers and footers with
ServerTextControl.


