示例#1
0
文件: Form1.cs 项目: L273/C_Sharp_LLK
        private void Form1_Load(object sender, EventArgs e)
        {
            Form3 form3 = new Form3();

            form3.ShowDialog();
            form3.Dispose();
            if (!form3.getInto())
            {
                this.Dispose();
            }
            else
            {
                //设置email
                this.email = form3.email;
                //初始化用户显示
                this.Text = "欢迎:" + this.judge.Who(this.email);


                // MessageBox.Show("登入成功");
            }
            //登入界面进入完成,接下来就是进入模式选择页面
            Form5 form5 = new Form5();

            form5.ShowDialog();
            form5.Dispose();

            this.time = form5.time;
            //设置时间
            this.mode = form5.mode;
            //设置模式
        }
示例#2
0
        private void setParameter(object sender, MouseEventArgs e)
        {
            Form1 form1 = (Form1)Form.ActiveForm;

            if (!form1.IsLinking)
            {
                try
                {
                    if (e.Clicks == 2)
                    {
                        try
                        {
                            Form3 form3 = new Form3("Machine ", "Ressources", "Temps de traitement");
                            form3.TextBox1.Text = this._buffer.ToString();
                            form3.TextBox2.Text = this._time.ToString();
                            if (form3.ShowDialog(this) == DialogResult.OK)
                            {
                                _buffer = System.Convert.ToInt32(form3.TextBox1.Text);
                                _time   = System.Convert.ToDouble(form3.TextBox2.Text);
                            }
                            form3.Dispose();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                            setParameter(sender, e);
                        }
                    }
                }
                catch { }
            }
        }
        private void setParameter(object sender, MouseEventArgs e)
        {
            Form1 form1 = (Form1)Form.ActiveForm;

            if (!form1.IsLinking)
            {
                try
                {
                    if (e.Clicks == 2)
                    {
                        try
                        {
                            Form3 form3 = new Form3("Feu ", "Durée feu Vert", "Durée feu Rouge");
                            form3.TextBox1.Text = this._dureeVert.ToString();
                            form3.TextBox2.Text = this._dureeRouge.ToString();
                            if (form3.ShowDialog(this) == DialogResult.OK)
                            {
                                _dureeVert  = System.Convert.ToInt32(form3.TextBox1.Text);
                                _dureeRouge = System.Convert.ToDouble(form3.TextBox2.Text);
                            }
                            form3.Dispose();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                            setParameter(sender, e);
                        }
                    }
                }
                catch { }
            }
        }