Beispiel #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                m_strText      = tbText.Text;
                m_dbHeight     = Convert.ToDouble(tbHeight.Text);
                m_dbPosX       = Convert.ToDouble(tbPosX.Text);
                m_dbPosY       = Convert.ToDouble(tbPosY.Text);
                m_dbAngle      = Convert.ToDouble(tbAngle.Text);
                m_nLayerNo     = Convert.ToInt32(tbLayNO.Text);
                m_dbBarRatio   = Convert.ToDouble(tbBarRatio.Text);
                m_dbLineDist   = Convert.ToDouble(tbLineDist.Text);
                m_dbShrink     = Convert.ToDouble(tbShrink.Text);
                m_dbRevWidth   = Convert.ToDouble(tbRevWidth.Text);
                m_dbRevHeight  = Convert.ToDouble(tbRevHeight.Text);
                m_strModelName = tbTextID.Text;
                m_strObjName   = tbObjName.Text;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("输入的数据不合法!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            int nRet = CSharpInterface.HS_AddBarcode(m_strText, m_nBarType, m_dbHeight, m_dbPosX, m_dbPosY, m_dbAngle, m_nAlign, m_nLayerNo,
                                                     m_dbBarRatio, m_dbLineDist, m_dbShrink, m_bReverse, m_dbRevWidth, m_dbRevHeight, m_bModify, m_strModelName, m_strObjName);

            if (nRet == 0)
            {
                MessageBox.Show("添加条码对象成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ClickAdd = true;
                this.Close();
            }
            else
            {
                MessageBox.Show("添加条码对象失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }