private void btnPrim6_Click(object sender, EventArgs e) { FrmDesign objDesign = new FrmDesign(); this.Close(); objDesign.btnCaculGeometry_Click(null, new EventArgs()); }
private void btnFourBefore_Click(object sender, EventArgs e) { FrmDesign objDesign = new FrmDesign(); this.Visible = false;//隐藏当前窗体 objDesign.btnMaterialSelect_Click(null, new EventArgs()); }
};//模数数组 private void btnFourNext_Click(object sender, EventArgs e) { FrmDesign objDesign = new FrmDesign(); this.Visible = false; //隐藏当前窗体 this.btnCalculateFour_Click(null, e); //调用确定按钮 objDesign.btnCaculGeometry_Click(null, new EventArgs()); //调用主窗体打开窗体4 }
double inPower, ration, inRevo, effic, outTor, outRevo, inTor, ka, loadScale;//定义变量接收窗体1传过来的值(输入功率、速比、转速、效率、输出扭矩、输出转速、输入扭矩,ka,不均匀系数) //public static FrmOne objOne ; private void btnPrimStep_Click(object sender, EventArgs e)//上一步 { FrmDesign obj = new FrmDesign(); this.Close();//隐藏当前窗体 //this.Dispose();//无法访问已释放的对象 obj.btnModifyPara_Click(null, new EventArgs()); //Timer fa = new Timer(); //fa.Stop(); }
//public static FrmThree objThree = null; private void btnNextStep_Click(object sender, EventArgs e)//下一步 { FrmDesign objD = new FrmDesign(); this.Visible = false; //隐藏当前窗体 //调用确定按钮事件=== this.btnCaculate_Click(null, new EventArgs()); //实现传值、 //调用主窗体按钮事件启动窗体3 objD.btnMaterialSelect_Click(null, e); //string s1 = Common.PassValues.sunMaterial; //string s2 = Common.PassValues.planMaterial; //string s3 = Common.PassValues.innMaterial; //PassDatas(s1, s2, s3); }
//public static FrmTwo objTwo = null; private void btnNextStep_Click(object sender, EventArgs e) { FrmDesign objD = new FrmDesign(); try { CaculateVal();//调用确定按钮代码 //委托传递参数值(传递给第二步窗体) // msgSender(inputPower, speedRatio, inputRevolo, drivenEfficient, outputTorque, outRevolo, inputTorque, KA); this.Hide(); objD.btnCaculGearNum_Click(null, new EventArgs());//调用主窗体事件创建子窗体2== /*ShowDialog()方法创建的窗体对象是个模式对话框, * 前一个窗体不关闭后一个窗体不能进行任何操作,show()和showdialog()方法区别参见百度*/ //激发事件传递窗体1的值 PassData1(inputPower, inputRevolo, speedRatio, drivenEfficient, inputTorque, outRevolo, outputTorque, KA, loadXishu); //传递窗体3的值 int plantaryNum = Common.PassValues.plantaryNum; double za = Common.PassValues.za; double zb = Common.PassValues.zb; double zc = Common.PassValues.zc; double reRation = Common.PassValues.reRation; //实际减速比 string rationGap = Common.PassValues.rationGap; //减速比误差 //实际输出转速和实际输出扭矩(计算) double outRevoReal = Common.PassValues.outRevoReal; //实际输出转速 double outTorReal = Common.PassValues.outTorReal; //实际输出扭矩 PassData(plantaryNum, za, zb, zc, reRation, rationGap, outTorReal, outRevoReal); //传递窗体3的值 string s1 = Common.PassValues.sunMaterial; string s2 = Common.PassValues.planMaterial; string s3 = Common.PassValues.innMaterial; PassDatas(s1, s2, s3); double v1 = Common.PassValues.faiD; double v2 = Common.PassValues.contactXY; double v3 = Common.PassValues.Tac; double v4 = Common.PassValues.a; double v5 = Common.PassValues.kc; double v6 = Common.PassValues.k; double v7 = Common.PassValues.u; double v8 = Common.PassValues.m; passData4(v1, v2, v3, v4, v5, v6, v7, v8); double β = 0.00; double aN = Common.PassValues.anone; double a = Common.PassValues.a; double xa = Common.PassValues.Xa; double xb = Common.PassValues.Xb; double xc = Common.PassValues.Xc; double d1 = Common.PassValues.d1; double d2 = Common.PassValues.d2; double d3 = Common.PassValues.d3; double da1 = Common.PassValues.da1; double da2 = Common.PassValues.da2; double da3 = Common.PassValues.da3; passData5(β, aN, a, xa, xb, xc, d1, d3, d2, da1, da3, da2); double c1 = Common.PassValues.contactA; double c2 = Common.PassValues.contactXY; double c3 = Common.PassValues.aBendVal; double c4 = Common.PassValues.cBendVal; double c5 = Common.PassValues.xyBenda; double c6 = Common.PassValues.xyBendc; passData6(c1, c2, c3, c4, c5, c6); } catch (Exception ex) { throw ex; } }