【问题标题】:How to create a checkbox using the DocX library如何使用 DocX 库创建复选框
【发布时间】:2017-02-18 13:03:19
【问题描述】:

DocX 库是否支持复选框控件?我正在浏览课程,但找不到 Checkbox 课程。如何使用 DocX 创建复选框?

【问题讨论】:

    标签: c# checkbox novacode-docx


    【解决方案1】:

    您可以添加复选框符号。

    /// <summary>
    /// Helper method to handle the special symbol text.
    /// </summary>
    /// <param name="hex"></param>
    /// <returns></returns>
    private char HexToChar(string hex)
    {
        return (char)ushort.Parse(hex, System.Globalization.NumberStyles.HexNumber);
    }
    

    然后,您可以将复选框作为普通文本插入。

    // generate a sentence, which includes two checkboxes.
    // checkbox Decimal Value is 9722, and Hex Value is 2610
    var checkbox = HexToChar("2610");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-13
      • 1970-01-01
      • 2011-04-28
      • 2014-01-26
      • 1970-01-01
      • 1970-01-01
      • 2018-05-03
      • 1970-01-01
      相关资源
      最近更新 更多