mindrayguowei 发表于 2015-8-27 16:21:00

如何设置HeaderFooter为ReadOnly?

如题,谢谢

iceman 发表于 2015-8-27 17:42:00

回复 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.";
      }

mindrayguowei 发表于 2015-8-28 08:41:00

不好意思,不只是HeaderFooter需要只读,MainText里面某些字段以及表格中某些cell的值也需要只读

gw0506 发表于 2015-8-28 10:44:00

这里有一篇博客,给出了如何设置TX中部分区域为只读的方法,请参考。
如何控制文档中部分区域为只读模式

iceman 发表于 2015-9-2 10:20:00

回复 3楼mindrayguowei的帖子

为了给你提供更优质的服务,请对本次服务进行评分。我们会认真对待你提出的宝贵意见,谢谢
http://gcdn.gcpowertools.com.cn/attachment.aspx?attachmentid=10062
页: [1]
查看完整版本: 如何设置HeaderFooter为ReadOnly?