Inheritance: form
Ejemplo n.º 1
0
 void b_Click(object sender, EventArgs e)
 {
     WinPcapDevice device = (WinPcapDevice)((Button)sender).Tag;
     Form2 form = new Form2();
     form.Run(device);
     form.Show(this);
 }
Ejemplo n.º 2
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     Form2 form = new Form2();
     form.MdiParent = this;
     form.Show();
     
 }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string s1 = "insert into login(name,cons,age,prof,password) values(@a,@b,@c,@d,@e)";
            MySqlCommand cmd = new MySqlCommand(s1, conn);
            cmd.Parameters.AddWithValue("@a", textBox1.Text);
            cmd.Parameters.AddWithValue("@b", textBox2.Text);
            cmd.Parameters.AddWithValue("@c", textBox3.Text);
            cmd.Parameters.AddWithValue("@d", textBox5.Text);
            cmd.Parameters.AddWithValue("@e", textBox4.Text);
            conn.Open();
            if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "")
            {
                MessageBox.Show("Pls fill in all the details");
                textBox1.Text = "";
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text ="";
                textBox5.Text = "";

            }
            else
            {
                int i = cmd.ExecuteNonQuery();
                MessageBox.Show("Your details have been submitted");
                textBox1.Text = "";
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "";
                this.Hide();
                Form2 f2 = new Form2();
                f2.ShowDialog();
            }
            conn.Close();
        }
Ejemplo n.º 4
0
 private void barSubItem15_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     XtraReport r = this.xrDesignPanel1.Report;
     Form2 frm = new Form2(r.FilterString);
     frm.ShowDialog();
     this.xrDesignPanel1.Report.FilterString = frm.Criteria;
 }
Ejemplo n.º 5
0
 void button1_Click(object sender, EventArgs e)
 {
     var form2 = new Form2();
     var timeout = TimeSpan.FromSeconds(3);
     var result = form2.ShowWithTimeout(timeout);
     MessageBox.Show(result.ToString());
 }
 private void button1_Click(object sender, EventArgs e)
 {
     Form2 frm = new Form2();
     frm.Show();
     //Esconde el primer Form
     this.Hide();
 }
Ejemplo n.º 7
0
 private void listView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     Handler h = new Handler();
     Data.Value = h.getTipByID((System.Int32.Parse(listView1.Items[listView1.SelectedIndices[0]].Name)));
     Form2 detailForm = new Form2();
     detailForm.Show();
 }
Ejemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;

            try
            {
                ExtractfileInfo();

                //dataGridView1.Rows.Clear();
                //dataGridView1.RowCount = ClerksList.Count;
                //for (int i = 0; i < ClerksList.Count; i++)
                //{
                //    dataGridView1.Rows[i].HeaderCell.Value = (i + 1).ToString();
                //    dataGridView1[0, i].Value = ClerksList[i].ID;
                //    dataGridView1[1, i].Value = ClerksList[i].Name;
                //    dataGridView1[2, i].Value = ClerksList[i].Mobile;
                //    dataGridView1[3, i].Value = ClerksList[i].Office;
                //    dataGridView1[4, i].Value = ClerksList[i].Dept;
                //}

                DisplayForm = new Form2(this, ClerksList, fileInfo);
                DisplayForm.Show();

                this.Visible = false;
            }
            catch(Exception ex)
            {
                MessageBox.Show("Excel数据导出失败,错误原因:\n" + ex.Message + "\n错误代码E014,请联系开发者,谢谢");
            }

            button1.Enabled = true;
        }
Ejemplo n.º 9
0
 private void start_Click(object sender, EventArgs e)
 {
     this.Hide();
     Form2 form2 = new Form2();
     form2.ShowDialog();
     this.Close();
 }
Ejemplo n.º 10
0
 public void ecranBleu()
 {
     Form2 bsod = new Form2();
     Cursor.Hide();
     bsod.Show();
     bsod.Activate();
 }
 private void buttonDone_Click(object sender, EventArgs e)
 {
     if (levelSelect.Text == "Level 1")
     {
         Form1 Form1 = new Form1();
         this.Hide();
         Form1.Show();
     }
     else if (levelSelect.Text == "Level 2")
     {
         Form2 Form2 = new Form2();
         this.Hide();
         Form2.Show();
     }
     else if (levelSelect.Text == "Level 3")
     {
         Form3 Form3 = new Form3();
         this.Hide();
         Form3.Show();
     }
     else
     {
         MessageBox.Show("Please Select a Level!");
     }
 }
Ejemplo n.º 12
0
 private void button2_Click(object sender, EventArgs e)
 {
     Form2 f2 = new Form2();
     this.Hide();
     f2.ShowDialog();
     this.ShowDialog();
 }
Ejemplo n.º 13
0
        private void initializeBrain()
        {
            SettingsWindow = new Form2(); // contains the settings
            int result = SettingsWindow.loadSettings();
            if (result == 0)
            {
                writeLineToConsole("Location of ffmpeg and folder for temporary converted files loaded from previous session");
            }
            else
            {
                writeLineToConsole("Initial values set for location of ffmpeg and folder for temporary converted files");
                writeLineToConsole("You can change these in the 'settings' menu");
            }
            // load all settings and add them to brain
            int valueOfObjectSize = SettingsWindow.getValueOfObjectSize();
            int valueofMovementWindow = SettingsWindow.getValueofMovementWindow();
            String convertedOutputFolder = SettingsWindow.getConvertedOutputFolder();
            String ffmpegLocation = SettingsWindow.getFfmpegLocation();

            ffmpegLocation = Path.GetDirectoryName(ffmpegLocation) + "\\" + Path.GetFileNameWithoutExtension(ffmpegLocation);

            brain = new Brain();
            // Settings:
            updateThresholdLabel();
            brain.updateThreshold(trackBar1.Value);
            brain.addSeriousSettings(ffmpegLocation, convertedOutputFolder);
            brain.addLessSeriousSettings(valueOfObjectSize, valueofMovementWindow);

            // not busy
            Busy = 0;
        }
Ejemplo n.º 14
0
 private void button1_Click(object sender, EventArgs e)
 {
     Form3 Form1 = new Form3();
     Form1.Show();
     Form2 form2 = new Form2();
     form2.Visible = false;
 }
Ejemplo n.º 15
0
        private void btnNovaForma_Click(object sender, EventArgs e)
        {
            Form2 temp = new Form2();

            temp.ControlBox = false;
            temp.Show();
        }
Ejemplo n.º 16
0
        private void aceptar_login_Click(object sender, EventArgs e)
        {
            try
            {

                user = username_login.Text;
                pass = password_login.Text;

                string connectionString = "Data Source=XE;User Id=" + user + ";Password="******";";

                conn = new OracleConnection(connectionString);
                conn.Open();
                cone = true;

                MessageBox.Show("Conexion Establecida con Exito", "Proyecto TDB1", MessageBoxButtons.OK,MessageBoxIcon.Asterisk);

                if (cone = true)
                {
                    Form2 Forma = new Form2();
                    this.Hide();
                    Forma.ShowDialog();

                }
                else {
                }

            }
            catch (Exception err)
            {

                MessageBox.Show("Conexion No Establecida || Usuario o Contraseña Denegada" + err.Message, "Proyecto TDB1", MessageBoxButtons.OK, MessageBoxIcon.Warning);

            }
        }
Ejemplo n.º 17
0
        private void changePlayersToolStripMenuItem_Click(object sender, EventArgs e) // File>Change Players
        {
            Form2 f2 = new Form2();
            f2.ShowDialog();

            label1.Text = player1 + "(X)";
            label3.Text = player2 + "(O)";
            o_win_count.Text = "0";
            x_win_count.Text = "0";
            draw_count.Text = "0";
            turn = true;
            turn_count = 0;
            haveWinner = false;

            foreach (Control c in Controls)
            {
                try
                {
                    Button b = (Button)c;
                    b.Enabled = true;
                    b.Text = "";
                    b.BackColor = SystemColors.Control;
                }
                catch { }
            }

            newGameButton.Text = "New Game";
        }
        public Form1()
        {
            InitializeComponent();

              _ruleEditor = new Form2();
              _ruleEditor.CustomRuleVisible = true;
        }
Ejemplo n.º 19
0
 public Form1()
 {
     initStreamWriter();
        form2 = new Form2(this, streamWriter);
        form2.Hide();
        InitializeComponent();
 }
Ejemplo n.º 20
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Form2 Form2 = new Form2();
     Form2.Show();
     Thread.Sleep(1000);
     Form2.Close();
 }
Ejemplo n.º 21
0
        private void button1_Click(object sender, EventArgs e)
        {
            // object Form2;

            //            string ipath1 = "c:\\tmp1\\このみタペ.jpg";
            string ipath1 = "c:\\tmp1\\ぱんちら.jpg";
            /* ぱんちらに変更 */

            // ファイル存在チェックして対応
            if (System.IO.File.Exists(ipath1))
            {
                pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; // 窓に大きさあわせる

                pictureBox1.Load(ipath1);

                /* ここから Form2生成して表示のコード試験 */
                Form2 myform2 = new Form2();

                myform2.Show();

                myform2.pictureBoxF2.SizeMode = PictureBoxSizeMode.Zoom; // 窓に大きさあわせる
                myform2.pictureBoxF2.Load(ipath1);

                button1.Text = "おーーけー!";
            }
            else {
                button1.Text = "いや ファイルがだめだ!";
            }
        }
Ejemplo n.º 22
0
        private void lOGINToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try { statusStrip1.Text = "connecting";
            Form2 login = new Form2();
            login.ShowDialog(this);
                if(!String.IsNullOrEmpty(login.Name))
                {
                    remotefactory = new ChannelFactory<Triva>("Chatconfig");
                    remoteproxy = remotefactory.CreateChannel();
                    clientuser = remoteproxy.ClientConnect(login.Name);
                    if (clientuser != null)
                    {
                        menuStrip1.Enabled = false;
                        button1.Enabled = true;
                        textBox2.Enabled = true;
                        isconnected = true;
                        statusStrip1.Text = "connect as" + clientuser.Name;
                    }
                    else
                        statusStrip1.Text = "disconnect";
                }

            }
            catch(Exception ex)
            {
                MessageBox.Show("an error occurred" + ex.Message,"fatal error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 23
0
        public Form1()
        {
            InitializeComponent();

            form2 = new Form2(this);
            form2.Visible = true;
        }
Ejemplo n.º 24
0
 private void button1_Click(object sender, EventArgs e)
 {
     m = panel1.CreateGraphics();
     m.DrawRectangle(pen, 20, 20, 20, 20);
     Form2 n = new Form2();
     n.Show();
 }
Ejemplo n.º 25
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Elcot\Documents\data.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
            SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) From login where username='******'and password='******'", con);
            DataTable dt = new DataTable();
            sda.Fill(dt);

            try
            {

                if (dt.Rows[0][0].ToString() == "1" || dt.Rows[0][1].ToString() == "1")
                {
                    this.Hide();
                    Form2 form2 = new Form2();
                    form2.Show();
                }
                else
                {
                    MessageBox.Show("please enter the valid username and password");
                }
            }
            catch
            {
                MessageBox.Show("please enter the id");
            }
        }
Ejemplo n.º 26
0
 public void throwError(string output)
 {
     Form2 errorWindow = new Form2(output);
     errorWindow.ShowInTaskbar = false;
     errorWindow.StartPosition = FormStartPosition.CenterScreen;
     errorWindow.ShowDialog(this);
 }
Ejemplo n.º 27
0
 // Createe a simple handler for the SpeechRecognized event.
 void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     int flag=0;
     if (e.Result.Text.Equals("yes"))
     {
         if (i == 0)
         {
             ob = new Form2(a);
             ob.Show();
             this.Hide();
             i++;
         }
     }
     else
     {
         if (i == 0)
         {
             MessageBox.Show("say YES to play");
             i++;
         }
         else
         {
             flag = ob.logic(e.Result.Text);
             if(flag==1)
             {
                 ob3 = new Form3(a);
                 ob3.Show();
                 ob.Hide();
             }
         }
     }
 }
Ejemplo n.º 28
0
 private void activar_formulario_login()
 {
     //Este thread lo único que hace es activar el formulario de login
     // Se pasa la información de conexión por parametro al nuevo formulario
     login = new Form2(server);
     login.ShowDialog();
 }
 private void button1_Click(object sender, EventArgs e)
 {
     this.Hide();
     var form = new Form2();
     form.Closed += (s, args) => this.Close();
     form.Show();
 }
Ejemplo n.º 30
0
 private void button1_Click(object sender, EventArgs e)
 {
     Form2 frmenglish = new Form2();
     this.Hide();
     frmenglish.ShowDialog();
     this.Close();
 }
Ejemplo n.º 31
0
    private void button1_Click(object sender, EventArgs e)
    {
        Form2 objForm2 = new Form2(thClass);

        objForm2.Show();
    }
 void Form1_Load(object sender, EventArgs e)
 {
    formChild = new Form2();
    formChild.MdiParent = this;
    formChild.Show();            
 }
Ejemplo n.º 33
0
 private void SomeMethod()
 {
     var f2 = new Form2(this);
 }
Ejemplo n.º 34
0
    private void button1_Click(object sender, EventArgs e)
    {
        Form2 frm = new Form2(this);

        frm.Show();
    }
 public Form1()
 {
     InitializeComponent();
     form2 = new Form2();
     form2.Show();
 }
 // other stuff
 private void button1_Click(object sender, EventArgs e)
 {
     if (f2 == null)
         f2 = new Form2(this);
     f2.Show();
 }
 // I have a `button1` on my Form1, and clicking this button shows Form2
 private void button1_Click(object sender, EventArgs e)
 {
     var form2 = new Form2();
     form2.Show();
 }
    private void Form1_Load(object sender, EventArgs e)
    {
        Form2 frm2 = new Form2();     //Show Form2 for Testing

        frm2.Show();
    }
Ejemplo n.º 39
0
 // Token: 0x060003C0 RID: 960 RVA: 0x0000A1E8 File Offset: 0x000083E8
 private void flatButton1_Click(object sender, EventArgs e)
 {
     if (Form2.smethod_0())
     {
         string    string_   = "http://45.88.76.158/loader/i.php";
         WebClient webClient = Form2.smethod_2();
         try
         {
             NameValueCollection nameValueCollection_ = Form2.smethod_5();
             Form2.smethod_7(nameValueCollection_, "login", Form2.smethod_6(this.Login));
             Form2.smethod_7(nameValueCollection_, "password", Form2.smethod_6(this.Pass));
             Form2.smethod_7(nameValueCollection_, "count", "1");
             byte[] byte_ = Form2.smethod_8(webClient, string_, nameValueCollection_);
             Form2.string_0 = Form2.smethod_10(Form2.smethod_9(), byte_);
         }
         finally
         {
             if (webClient != null)
             {
                 Form2.smethod_4(webClient);
             }
         }
         string text = Form2.string_0;
         if (text != null)
         {
             if (Form2.smethod_11(text, "1"))
             {
                 if (this.flatCheckBox1.Boolean_0)
                 {
                     Settings.Default.Pos   = this.flatCheckBox1.Boolean_0;
                     Settings.Default.Login = Form2.smethod_6(this.Login);
                     Settings.Default.Pass  = Form2.smethod_6(this.Pass);
                     Form2.smethod_12(Settings.Default);
                 }
                 else
                 {
                     Settings.Default.Pos   = false;
                     Settings.Default.Login = "";
                     Settings.Default.Pass  = "";
                     Form2.smethod_12(Settings.Default);
                 }
                 Form2.smethod_13(new Form1());
                 return;
             }
             if (Form2.smethod_11(text, "2"))
             {
                 Form2.smethod_14("Неправильный логин или пароль!", " Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 return;
             }
             if (Form2.smethod_11(text, "3"))
             {
                 Form2.smethod_15("0!");
                 return;
             }
             if (!Form2.smethod_11(text, "6"))
             {
                 return;
             }
             Form2.smethod_14("Проблема с сервером!", " Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         }
     }
 }
Ejemplo n.º 40
0
 private void button1_Click(object sender, EventArgs e)
 {
     settingsWindow = new Form2(this);
     settingsWindow.HandleCreated += SettingsWindow_HandleCreated;
     settingsWindow.ShowDialog();
 }
    public ItemView(ItemDisc i, Panel p, Panel p2, Form2 f)
    {
        IsCancelButton = IsOrder;
        form           = f;
        if (i.Quantity > 0)
        {
            if ((itemNum % 4 == 0 && itemNum != 0))
            {
                x_offset  = 0;   // item will be first in the new row
                y_offset += 180; //vertical distance between each row
            }
            Item          = i;
            ParentPanel   = p;
            productsPanel = p2;

            //Product picture proprties
            if (!IsOrder)
            {
                pic.BackgroundImage = i.GetImage();
                pic.Location        = new Point(38 + x_offset, 70 + y_offset);
                pic.Size            = new Size(100, 100);
            }

            //product name label proprties
            if (IsOrder)
            {
                name.Location = new Point(38, 58 + y_offset);
            }
            else
            {
                name.Location = new Point(38 + x_offset, 158 + y_offset);
            }
            name.Text      = i.name;
            name.Font      = new Font("Britannic Bold", 12);
            name.ForeColor = Color.RoyalBlue;
            name.BackColor = Color.Transparent;
            //product price label proprties
            if (IsOrder)
            {
                price.Location = new Point(150, 58 + y_offset);
                price.Text     = i.Quantity.ToString() + " Items each cost " + i.price.ToString() + "$";
                price.Size     = new Size(200, 20);
            }
            else
            {
                price.Location = new Point(38 + x_offset, 180 + y_offset);
                price.Text     = i.price.ToString() + "$";
            }
            price.ForeColor = Color.Green;

            //product buy button proprties
            if (IsOrder)
            {
                buybutton.Location = new Point(350, 58 + y_offset);
                buybutton.Text     = "Cancel";
            }
            else
            {
                buybutton.Location = new Point(38 + x_offset, 200 + y_offset);
                buybutton.Text     = "Buy";
            }
            buybutton.MouseEnter += button_MouseEnter;
            buybutton.MouseLeave += button_MouseLeave;
            buybutton.Click      += BuyClick;
            if (IsOrder)
            {
                State.Location = new Point(450, 58 + y_offset);
                State.Font     = new Font("Britannic Bold", 12);
                if (Item.state == DeliveryState.Pending)
                {
                    State.Text = "Pending"; State.ForeColor = Color.Red;
                }
                if (Item.state == DeliveryState.InProgress)
                {
                    State.Text = "InProgress"; State.ForeColor = Color.Orange;
                }
                if (Item.state == DeliveryState.Delieverd)
                {
                    State.Text = "Delieverd"; State.ForeColor = Color.Green; buybutton.Text = "Delete";
                }
            }

            x_offset += 200;//horizontal distance between products

            //adding products to home panel
            if (IsOrder)
            {
                p.Controls.Add(State);
            }
            p.Controls.Add(buybutton);
            p.Controls.Add(name);
            p.Controls.Add(price);
            if (!IsOrder)
            {
                p.Controls.Add(pic);
                itemNum++;
            }
            else
            {
                y_offset += 27;
            }
        }
    }
    private void btn_prew_Click(object sender, EventArgs e)
    {
        Form2 frm2 = new Form2(listView1);

        frm2.Show();
    }
Ejemplo n.º 43
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form2 model = new Form2();

            if (idDgGridForm3 == 0)
            {
                model.clear = add;
            }
            else
            {
                model.clear = clearForm3;
            }

            model.idDgGridForm2 = idDgGridForm3;

            model.titleForm2            = titleForm3;
            model.numberOfPortionsForm2 = numberOfPortionsForm3;

            model.amountsOfIngredientsForm2 = AmountsOfFoodForm3;
            model.gramsForm2      = gramsForm3;
            model.ingredientForm2 = ingredientForm3;

            model.ShortDescriptionForm2 = shortDescriptionForm3;
            model.instructionForm2      = InstructionForm3;

            photoForm3 = rtxtLinkForm3.Text;
            if (photoForm3 == null || photoForm3 == "")
            {
                photoForm3 = "-";
            }
            model.linkForm2  = photoForm3;
            model.linkForm22 = LinkForm23;

            if (listOfCuisinesForm3 == null || listOfCuisinesForm3 == "")
            {
                listOfCuisinesForm3 = "-";
            }
            model.listOfCuisinesForm2 = listOfCuisinesForm3;

            if (RatingForm3 == null || RatingForm3 == "")
            {
                RatingForm3 = "-";
            }
            model.idRatingForm2 = RatingForm3;

            if (difficultLevelForm3 == null || difficultLevelForm3 == "")
            {
                difficultLevelForm3 = "-";
            }
            model.difficultLevelForm2 = difficultLevelForm3;

            if (executionTimeForm3 == null || executionTimeForm3 == "")
            {
                executionTimeForm3 = "-";
            }
            model.executionTimeForm2 = executionTimeForm3;

            model.unlockFieldsForm2 = unlockFieldsForm3;

            // p.AddRecipeForm2 = addRecipeForm3;
            model.addRecipe            = addRecipe;
            model.InTheProcessOfAdding = InTheProcessOfAdding;
            InTheProcessOfAdding       = false;

            model.correctModyficationName = correctModyficationName3;

            #region MealAdd
            model.checkBoxDish[0] = IdMealForm3[0];
            model.checkBoxDish[1] = IdMealForm3[1];
            model.checkBoxDish[2] = IdMealForm3[2];
            model.checkBoxDish[3] = IdMealForm3[3];
            model.checkBoxDish[4] = IdMealForm3[4];
            model.checkBoxDish[5] = IdMealForm3[5];
            model.checkBoxDish[6] = IdMealForm3[6];
            #endregion

            #region ComponentAdd
            model.checkBoxIngredients[0] = idComponentsForm3[0];
            model.checkBoxIngredients[1] = idComponentsForm3[1];
            model.checkBoxIngredients[2] = idComponentsForm3[2];
            model.checkBoxIngredients[3] = idComponentsForm3[3];
            model.checkBoxIngredients[4] = idComponentsForm3[4];
            model.checkBoxIngredients[5] = idComponentsForm3[5];
            model.checkBoxIngredients[6] = idComponentsForm3[6];
            model.checkBoxIngredients[7] = idComponentsForm3[7];
            #endregion

            model.counterForm2 = counterForm3;

            #region Pamięć
            model.title1    = title3;
            model.amounts   = amounts3;
            model.ingrediet = ingrediet3;
            model.shortDes  = shortDes3;
            model.longDes   = longDes3;
            model.cuisines  = cuisines3;
            model.level     = level3;
            model.time      = time3;
            model.rating    = rating3;
            model.portions  = portions3;
            model.cancel    = cancel3;
            #endregion

            model.SavedCheckBoxForm2 = SavedCheckBoxForm3;
            model.newForm            = newForm3;

            this.Hide();
            model.ShowDialog();
        }
Ejemplo n.º 44
0
 protected override void OnShown(EventArgs e) {
     base.OnShown(e);
     Instance = this;
 }
Ejemplo n.º 45
0
    // assume strings have been added to articles by this point.

    // option 1 - use same ListArticle instance
    public void Foo()
    {
        var form = new Form2();

        form.Articles = _articles;
    }
Ejemplo n.º 46
0
 public CadastroDeConta(Form2 form)
 {
     this.form = form;
     InitializeComponent();
     contaTipo.SelectedIndex = 0;
 }
Ejemplo n.º 47
0
 protected override void OnClosed(EventArgs e) {
     base.OnClosed(e);
     Instance = null;
 }
 public LowerCurtain(Form2 form2)
 {
     this.form2 = form2;
 }
 private void btnClose_Click(object sender, EventArgs e)
 {
     Form2 f2 = new Form2(this);
     f2.ShowDialog();
 }        
Ejemplo n.º 50
0
    private void button1_Click(object sender, EventArgs e)
    {
        Form2 frm2 = new Form2(serialPort1);

        frm2.Show();
    }
 public RaiseCurtain(Form2 form2)
 {
     this.form2 = form2;
 }
Ejemplo n.º 52
0
 public LoadWindow(Form2 form2)
 {
     this.form = form2;
     InitializeComponent();
     loadSimulationName();
 }
    private void CreateForm2()
    {
        var form2 = new Form2(this);

        form2.Show();
    }
Ejemplo n.º 54
0
        private void InfoCompras(object sender, RoutedEventArgs e)
        {
            Form2 RV = new Form2();

            RV.ShowDialog();
        }
Ejemplo n.º 55
0
        public void Registration(TextBox textBox1, TextBox textBox2, TextBox textBox3, TextBox textBox4, Form2 form2)
        {
            DataBase dataBase = new DataBase();

            dataBase.ConnectionString();
            var reLoginCheck = from u in dataBase.LogPassDBs
                               where u.Login == textBox1.Text
                               select new { reLogin = true };

            if (textBox1.Text.Length < 3)
            {
                MessageBox.Show("Логин должен быть длинной больше трех символов!");
            }
            else if (textBox2.Text.Length < 5 && textBox3.Text.Length < 5)
            {
                MessageBox.Show("Пароль должен быть длинной больше пяти символов!");
            }
            else if (textBox2.Text != textBox3.Text)
            {
                MessageBox.Show("Пароли не совпадают!");
            }
            else if (reLoginCheck.Any() == true)
            {
                MessageBox.Show("Такой логин уже существует!");
            }
            else if (string.IsNullOrEmpty(textBox4.Text) == true)
            {
                MessageBox.Show("Введите количество денежных средств!");
            }
            else
            {
                LogPassDB logPassDB = new LogPassDB {
                    Login = textBox1.Text, Password = textBox2.Text
                };
                dataBase.LogPassDBs.InsertOnSubmit(logPassDB);
                dataBase.Db.SubmitChanges();
                Id = logPassDB.Id_Account;

                MoneyCountDB moneyCountDB = new MoneyCountDB {
                    Id_Account = Id, MoneyCount = Convert.ToDecimal(textBox4.Text)
                };
                dataBase.MoneyCountDBs.InsertOnSubmit(moneyCountDB);
                dataBase.Db.SubmitChanges();

                MessageBox.Show("Регистрация успешна");
                Form1 f1 = new Form1();
                form2.Close();
                f1.Show();
            }
        }