0

我有 MainForm (WinForm) 和名为 capture signature 的按钮。在Click这个按钮的情况下,我正在创建实例 CaptureSignatureForm,代码如下。

MainForm oSign = new MainForm(this);
oSign.ShowDialog();

当表单打开时,我捕获签名,捕获后,表单将关闭。
第二次单击 capturesignature 按钮时,它会引发错误:"Object reference not set to an instance of an object"

我正在使用第三方 dll 来捕获签名。

我在 if 条件下的斜体粗体文本出现错误。contol 是 signaturecapturedevice 的对象。根据第三方文档(连接到平板电脑时会自动填充功能对象。)

  if (control.EnsureConnected() && ***control.capabilities.LCDWidth != 0***)
            {
                this.ClientSize = new Size(tabletWidth, tabletHeight);

                if (model == Model.STU300)
                {
                    btnOk.SetBounds(tabletWidth - 80, 0, 80, tabletHeight / 3);
                    btnClear.SetBounds(tabletWidth - 80, tabletHeight / 3, 80, tabletHeight / 3);
                    btnCancel.SetBounds(tabletWidth - 80, (tabletHeight / 3) * 2, 80, tabletHeight / 3);
                }
                else
                {
                    btnOk.SetBounds(0, tabletHeight - 55, tabletWidth / 3, 55);
                    btnClear.SetBounds(tabletWidth / 3, tabletHeight - 55, tabletWidth / 3, 55);
                    btnCancel.SetBounds((tabletWidth / 3) * 2, tabletHeight - 55, tabletWidth / 3, 55);
                }
4

1 回答 1

0

似乎在调用 capabilities.LCDWidth 并且功能没有价值时出现异常,请检查供应商文档以获取功能或尝试探索 control.Reconnect/Close 任何此类,然后尝试运行它

于 2012-09-26T10:40:56.573 回答