예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    num;
            ushort loc;

            try
            {
                loc = ushort.Parse(textBox3.Text);
                num = int.Parse(textBox2.Text);
                Componets cp = new Componets(textBox1.Text, comboBox1.Text, comboBox2.Text, num, richTextBox1.Text, loc, Picture);
                this.Close();
                if (inf == 0)
                {
                    Form1.al.Add(cp);
                }
                else
                {
                    Form1.al.Insert(Index, cp);
                }
            }
            catch
            {
                MessageBox.Show("不要输入错误数据");
            }
        }
예제 #2
0
파일: Form2.cs 프로젝트: ZHHASO/auto
 public Form2(Componets cp,int Index)
 {
     inf = 1;
     InitializeComponent();
     textBox1.Text = cp.Name;
     comboBox1.Text = cp.Type;
     comboBox2.Text = cp.Type;
     textBox2.Text = cp.Pieces.ToString();
     textBox3.Text = cp.Location.ToString();
     richTextBox1.Text = cp.Information;
     button1.Text = "修改";
     this.Index = Index;
 }
예제 #3
0
 public Form2(Componets cp, int Index)
 {
     inf = 1;
     InitializeComponent();
     textBox1.Text     = cp.Name;
     comboBox1.Text    = cp.Type;
     comboBox2.Text    = cp.Type;
     textBox2.Text     = cp.Pieces.ToString();
     textBox3.Text     = cp.Location.ToString();
     richTextBox1.Text = cp.Information;
     button1.Text      = "修改";
     this.Index        = Index;
 }
예제 #4
0
파일: Form2.cs 프로젝트: ZHHASO/auto
 private void button1_Click(object sender, EventArgs e)
 {
     int num;
     ushort loc;
     try
     {
         loc = ushort.Parse(textBox3.Text);
         num = int.Parse(textBox2.Text);
         Componets cp = new Componets(textBox1.Text, comboBox1.Text, comboBox2.Text, num, richTextBox1.Text,loc,Picture);
         this.Close();
         if (inf == 0)
         {
             Form1.al.Add(cp);
         }
         else
         {
             Form1.al.Insert(Index,cp);
         }
     }
     catch
     {
         MessageBox.Show("不要输入错误数据"); 
     }
 }