Пример #1
0
        /// <summary>
        /// 点击生成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("不能打印空内容,请输入!");
                return;
            }
            dob = new DoBarCode(textBox1.Text, p1s, p2s, pps);

            pictureBox1.Image = dob.Get1DBarCode();
            pictureBox2.Image = dob.Get2DBarCode();
            if (string.IsNullOrEmpty(textBox4.Text))
            {
                textBox4.Text = @"..\\..\\Resources\\Picture.jpg";
            }
            pictureBox3.Image = dob.GetP2DBarCode(textBox4.Text);
            if (sender.ToString() != "History")
            {
                bool IsExist = true;
                foreach (var item in listBox1.Items)
                {
                    if (item.ToString() == textBox1.Text)
                    {
                        IsExist = false;
                    }
                }
                if (IsExist)
                {
                    listBox1.Items.Add(textBox1.Text);
                }
            }
        }
Пример #2
0
        private void radioButtonExc(RCodeType rct)
        {
            dob               = new DoBarCode((int)numericUpDown1.Value, textBox2.Text, textBox3.Text, rct, p1s, p2s, pps);
            textBox1.Text     = dob.GetBarCode();
            pictureBox1.Image = dob.Get1DBarCode();
            pictureBox2.Image = dob.Get2DBarCode();
            if (string.IsNullOrEmpty(textBox4.Text))
            {
                textBox4.Text = @"..\\..\\Resources\\Picture.jpg";
            }
            pictureBox3.Image = dob.GetP2DBarCode(textBox4.Text);
            bool IsExist = true;

            foreach (var item in listBox1.Items)
            {
                if (item.ToString() == textBox1.Text)
                {
                    IsExist = false;
                }
            }
            if (IsExist)
            {
                listBox1.Items.Add(textBox1.Text);
            }
        }