private void ButtonClick(object sender, EventArgs e) { ControlIndex = (Control)sender; switch (sender.ToString().Split(',')[0].Split('.')[1]) { case "mButtonStart": //MessageBox.Show("mButton_Start"); mButtonStart ButtonStart = (mButtonStart)ControlIndex; this.PropertyLabelArray[0].Text = "启动延时"; this.PropertyLabelArray[0].Show(); this.PropertyTextBoxArray[0].Text = ButtonStart.DelayTime.ToString(); this.PropertyTextBoxArray[0].Show(); break; default: MessageBox.Show(sender.ToString().Split(',')[0].Split('.')[1]); break; } }
private void PropertyChangeConfirm_Click(object sender, EventArgs e) { switch (ControlIndex.ToString().Split(',')[0].Split('.')[1]) { case "mButtonStart": //MessageBox.Show("mButton_Start"); mButtonStart ButtonStart = (mButtonStart)ControlIndex; ButtonStart.DelayTime = int.Parse(this.PropertyTextBoxArray[0].Text); break; default: MessageBox.Show(ControlIndex.ToString().Split(',')[0].Split('.')[1]); break; } for (int i = 0; i < 10; i++) { this.PropertyLabelArray[i].Hide(); this.PropertyTextBoxArray[i].Hide(); } }