//测试用的重载 public FormMain() { InitializeComponent(); //button2.Click += button1_Click; myOperator = new AlgorithmOperator(); initAll(); }
public FormOperating(AlgorithmOperator b, Resourse d, string n)//初始化各控件和属性 { InitializeComponent(); this.demand = d; this.name = n; CheckForIllegalCrossThreadCalls = false; this.myOperator = b; foreach (Control control in this.Controls) { if (control is PictureBox) { pictureBoxes.Add((PictureBox)control); } } Console.WriteLine(pictureBoxes.Count); foreach (Control control in this.groupBox1.Controls) { if (control is Label) { //listBox1.Items.Add(control.Name); avaiLables.Add((Label)control); } } this.label_avaiA.Text = myOperator.available.A.ToString(); this.label_avaiB.Text = myOperator.available.B.ToString(); this.label_avaiC.Text = myOperator.available.C.ToString(); init_draw(); //listBox1.CheckForIllegalCrossThreadCalls = false; }
public FormMain(MyDictionary <string, int> dic) { InitializeComponent(); this.dic = dic; //button2.Click += button1_Click; myOperator = new AlgorithmOperator(dic); initAll(); }
private void ResetAll(object sender, EventArgs e)//重置所有值 { this.myOperator = new AlgorithmOperator(dic); refresh(); }