kitara 发表于 2013-5-4 18:57:00

关于在页眉插入条形码的问题

版主您好:
    在TextControl里面添加条形码可以通过textControl1.Barcodes.Add()的方式,但是这样只能添加到正文区域里面,如何能在页眉里面动态添加条形码呢?
    通过TXTextControl.HeaderFooter类接收到页眉页脚之后好像无法在里面添加条形码,只能添加TextField,Image,Table,TextFrame等。请问有什么解决办法吗?

iceman 发表于 2013-5-6 18:20:00

回复 1楼kitara的帖子

请使用以下代码添加:

      private void addBarCodeToolStripMenuItem_Click(object sender, EventArgs e)
      {
            this.textControl1.HeadersAndFooters.Add(TXTextControl.HeaderFooterType.FirstPageHeader);
            TXTextControl.HeaderFooter header = this.textControl1.HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.FirstPageHeader);
            header.Activate();

            TXTextControl.Barcode.TXBarcodeControl txBarControl = new TXTextControl.Barcode.TXBarcodeControl();
            TXTextControl.DataVisualization.BarcodeFrame bc = new TXTextControl.DataVisualization.BarcodeFrame(txBarControl);
            this.textControl1.Barcodes.Add(bc, this.textControl1.InputPosition.TextPosition);
      }
页: [1]
查看完整版本: 关于在页眉插入条形码的问题