private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { switch (tabControl1.SelectedIndex) { //case 0: // Page = 1; // Back.Visible = false; // Step1.Focus(); // break; case 0: Page = 2; Back.Visible = true; Step2.Focus(); //清空所有控件 break; case 1: //MessageBox.Show(Application.StartupPath + @"\pic\formingShape\" + Step2select + ".JPG"); if (string.IsNullOrEmpty(Step2select)) { tabControl1.SelectedTab = Step2; MessageBox.Show("Error:Step2未选择!"); Step2.Focus(); return; } //_X0 = ComTransFrom._F(X0.Text); //_Y0 = ComTransFrom._F(Y0.Text); //_Z0 = ComTransFrom._F(Z0.Text); step3Pic.Image = Image.FromFile(Application.StartupPath + @"\pic\formingShape\" + Step2select + ".JPG"); Page = 3; Back.Visible = true; this.step3Pic.Controls.Clear(); step3(); addtextbox(); Step3.Focus(); break; } //MessageBox.Show(Page.ToString()); }
private void formingShape_Shown(object sender, EventArgs e) { Step2.Focus(); }
private void Step1Next_Click(object sender, EventArgs e) { switch (Page) { //case 1: // tabControl1.SelectedTab = Step2; // break; case 2: if (string.IsNullOrEmpty(Step2select)) { MessageBox.Show("Error:Step2未选择!"); Step2.Focus(); return; } tabControl1.SelectedTab = Step3; break; case 3: string temp = string.Empty; foreach (Control cur in this.step3Pic.Controls) { if (cur is TextBox) { temp += ComTransFrom._F(cur.Text) + " ,"; } } temp = temp.Substring(0, temp.Length - 2); step3info[0] = String.Format(step3info[0] + ";\r\n", temp); //MessageBox.Show(step3info[0]); //pall.bodyID += 1; //string check1 = "0"; //if(checkBox1.CheckState==CheckState.Checked) //{ // check1 = "1"; //} //string check2 = "0"; //if (checkBox2.CheckState == CheckState.Checked) //{ // check2 = "1"; //} //string v = string.Empty; //if (TypeSelect == "Extrude") //{ // v = String.Format("AGM.Sketcher.Extrude( {0}, {1}, {2}, 0, {3}, {4} );\r\n", step3info[0], ComTransFrom._F(textBox1.Text), check1, check2, ComTransFrom._F(textBox2.Text)); //} //else //{ // v = String.Format("AGM.Sketcher.Revolve( {0}, true, 0, {1}, false );\r\n", step3info[0], ComTransFrom._F(textBox2.Text)); //} //v += "AGM.Sketcher.FixModel();\r\n"; //v += String.Format("var body{0} = GetBody();\r\n", pall.bodyID.ToString()); //v += pall.richTextBox1.Text += step3info[0]; this.Close(); this.Dispose(); break; } //pictureBox1.Image = Image.FromFile(@"C:\Users\Host003\Documents\Visual Studio 2008\Projects\SID\WindowsFormsApplication6\bin\Release\pic\Sketch\Edge_1A.bmp"); }