回复 1楼mindrayguowei的帖子
可以通过 e.HeaderFooter.Deactivate(); 实现,测试代码如下:
- private void textControl1_HeaderFooterActivated(object sender, TXTextControl.HeaderFooterEventArgs e)
- {
- e.HeaderFooter.Deactivate();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- TXTextControl.Section currentSection = textControl1.Sections.GetItem();
- TXTextControl.HeaderFooter currentHeader =
- currentSection.HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header);
- if (currentHeader == null)
- {
- currentSection.HeadersAndFooters.Add(TXTextControl.HeaderFooterType.Header);
- currentHeader = currentSection.HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header);
- }
- currentHeader.Selection.Text = "This is a header with an image aligned to the right.";
- }
复制代码 |