当前位置: 首页>>代码示例>>C#>>正文


C# Form2.ShowDialog方法代码示例

本文整理汇总了C#中Form2.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# Form2.ShowDialog方法的具体用法?C# Form2.ShowDialog怎么用?C# Form2.ShowDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Form2的用法示例。


在下文中一共展示了Form2.ShowDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: pictureBox1_Click

 private void pictureBox1_Click(object sender, EventArgs e)
 {
     Form2 f = new Form2();
     this.Visible = false;
     f.ShowDialog();
     this.Visible = true;
 }
开发者ID:Goranmk20,项目名称:BlackJack,代码行数:7,代码来源:Form1.cs

示例2: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            int resposta;
            //Armazenamento da resposta do utilizador na MessageBox
            //Botão Yes - Valor 6
            //Botão No - Valor 7
            //Botão Cancelar - Valor 2
            resposta = Convert.ToInt32(MessageBox.Show("Pretende continuar?",
              "Mensagem", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question));
            //Avaliação da resposta dada
            if (resposta == 6)
            {

                Form2 frm = new Form2();
                frm.ShowDialog();
            }
            else if (resposta == 7)
            {
                MessageBox.Show("Carregou em Não", "Mensagem", MessageBoxButtons.OK,
                MessageBoxIcon.Information);
            }
            else if (resposta == 2)
            {
                MessageBox.Show("Carregou em Cancelar", "Mensagem",
                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
开发者ID:epcjc,项目名称:LP1213_M17_03,代码行数:27,代码来源:Form1.cs

示例3: experteneinstellungenToolStripMenuItem_Click

        private void experteneinstellungenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form2 expertenEinstellungen = new Form2();

            expertenEinstellungen.TheParent = this;
            expertenEinstellungen.ShowDialog();
        }
开发者ID:vulture20,项目名称:LabelPrinter,代码行数:7,代码来源:Form1.cs

示例4: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     string user = textBox1.Text;
     string pass = textBox2.Text;
     if (user == "kamyar")
         if (pass == "kamyar")
         {
             var regionReq = new Form2();
             regionReq.ShowDialog();
             //MessageBox.Show("kamyar signed in");
         }
         else
         {
             MessageBox.Show("کلمه عبور با شناسه مطابقت ندارد");
         }
     if(user=="momeni")
         if (pass == "rad")
         {
             var regionReq = new Form3();
             regionReq.ShowDialog();
             
         }
         else
         {
             MessageBox.Show("کلمه عبور با شناسه مطابقت ندارد");
         }
     
 }
开发者ID:momenirad,项目名称:GrayWolf2.3,代码行数:28,代码来源:Form1.cs

示例5: button3_Click

 private void button3_Click(object sender, EventArgs e)
 {
     Form2 ff = new Form2();
     this.Hide();
     ff.ShowDialog();
     ff.Close();
 }
开发者ID:amal2016,项目名称:hospital,代码行数:7,代码来源:adddept.cs

示例6: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     Form2 frmenglish = new Form2();
     this.Hide();
     frmenglish.ShowDialog();
     this.Close();
 }
开发者ID:Darcade,项目名称:MW3-Music-Tool,代码行数:7,代码来源:Form1.cs

示例7: throwError

 public void throwError(string output)
 {
     Form2 errorWindow = new Form2(output);
     errorWindow.ShowInTaskbar = false;
     errorWindow.StartPosition = FormStartPosition.CenterScreen;
     errorWindow.ShowDialog(this);
 }
开发者ID:elimonova,项目名称:ExtremSearch,代码行数:7,代码来源:Form1.cs

示例8: activar_formulario_login

 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();
 }
开发者ID:maneta,项目名称:Proyecto_SO,代码行数:7,代码来源:Form1.cs

示例9: button3_Click

 private void button3_Click(object sender, EventArgs e)
 {
     //Otvaramo drugu formu
     Form2 f2 = new Form2();
     //f2.Show(); //Pokaži me u paraleli
     f2.ShowDialog();
 }
开发者ID:vsite-prog,项目名称:DOTN,代码行数:7,代码来源:Form1.cs

示例10: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     Form2 secondForm = new Form2();
     secondForm.ShowInTaskbar = false;               //ховаємо форму з панелі задач
     secondForm.StartPosition = FormStartPosition.CenterScreen; //встановлюємо форму в центрі екрану
     secondForm.ShowDialog(this);                //указуємо хазяїна для форми
 }
开发者ID:joitribiani,项目名称:alarm-clock,代码行数:7,代码来源:Form1.cs

示例11: appointmentToolStripMenuItem_Click

 private void appointmentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.Hide();
     Form2 frm = new Form2();
     frm.ShowDialog();
     this.Show();
 }
开发者ID:kanke,项目名称:cal,代码行数:7,代码来源:Form1.cs

示例12: btnLogin_Click

        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {

                SqlCommand comm = new SqlCommand("SELECT Name FROM Admin WHERE Username = @username AND Password = @password;", SQLConnection.Connection);
                comm.Parameters.AddWithValue("@username", txtLoginID.Text);
                comm.Parameters.AddWithValue("@password", txtLoginPass.Text);
                comm.Connection.Open();
                object result = comm.ExecuteScalar();
                // scalar select icin- nonquery tsql kodlari icin
                if (result!=null) // checks value
                {
                    // lf it has
                    MessageBox.Show("Welcome " + result.ToString()); // tostring()  converts variable which comes as object to string
                    Form2 form2 = new Form2();
                    this.Hide();
                    form2.ShowDialog();

                }
                else
                {
                    MessageBox.Show("Invalid Username or Password.");
                }

            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message);
            }
            finally {
                SQLConnection.Connection.Close();
            }
        }
开发者ID:AlicanBalik,项目名称:librarysystem,代码行数:35,代码来源:Form1.cs

示例13: btnEdit_Click

        private void btnEdit_Click(object sender, EventArgs e)
        {
            DataGridViewRow CR = dataGridView1.CurrentRow;
            if (CR == null)
            {
                MessageBox.Show("편집할 행을 먼저 선택하십시오.");
                return;
            }
            int ID = (int)CR.Cells[0].Value;

            Form2 dlg = new Form2();
            dlg.Text = "친구 정보 수정";

            dlg.Name1 = (string)CR.Cells[1].Value;
            dlg.Male = (bool)CR.Cells[2].Value;
            dlg.Birth = (DateTime)CR.Cells[3].Value;
            dlg.Addr = (string)CR.Cells[4].Value;
            dlg.HandPhone = (string)CR.Cells[5].Value;
            dlg.Email = (string)CR.Cells[6].Value;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                JusoRokDataSet.tblJusoRow Row = jusoRokDataSet.tblJuso.FindByID(ID);
                Row.Name = dlg.Name1;
                Row.Birth = dlg.Birth;
                Row.Male = dlg.Male;
                Row.Addr = dlg.Addr;
                Row.HandPhone = dlg.HandPhone;
                Row.Email = dlg.Email;
            }
        }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:31,代码来源:Form1.cs

示例14: btnProductos_Click

        private void btnProductos_Click(object sender, EventArgs e)
        {
            Form2 nuevoProducto = new Form2();
            
            if (nuevoProducto.ShowDialog(this) == DialogResult.OK)
            {
                int codigo = Int32.Parse(nuevoProducto.txtCodigo.Text);
                string descripcion = nuevoProducto.txtDescicipcion.Text;
                int cantidad = Int32.Parse(nuevoProducto.txtCantidad.Text);
                double precio = Double.Parse(nuevoProducto.txtPrecio.Text);
                double totalLinea = cantidad * precio;
                total += totalLinea;

                txtTotal.Text = total.ToString();

                factura.Lineas.Add(new Linea(codigo, descripcion, cantidad, precio, totalLinea));

                dataGridView1.DataSource = factura.Lineas.ToArray();

                Console.WriteLine("si");
            }
            else
            {
                Console.WriteLine("no");

            }
            nuevoProducto.Dispose();
           
            
        }
开发者ID:Maldercito,项目名称:adat,代码行数:30,代码来源:Form1.cs

示例15: newGame

 //Creates a new game
 public void newGame()
 {
     INPROGRESS = true;
     WIN = false;
     LOSE = false;
     Tile[][] tempBoard;
     using (Form2 form2 = new Form2())
     {
         DialogResult d = form2.ShowDialog();
         if (d == DialogResult.OK)
         {
             percentMines = (double)(form2.percentMines)/100.0;
         }
     }
     tempBoard = new Tile[size][];
     //Initializing array
     for (int i = 0; i < size; i++)
     {
         tempBoard[i] = new Tile[size];
         for(int j = 0; j < size; j++)
         {
             tempBoard[i][j] = new Tile();
         }
     }
     board = tempBoard;
     placeMines();
     fillInMinecount();
     System.Console.WriteLine(ToString());
 }
开发者ID:lafeldtb,项目名称:Winter16,代码行数:30,代码来源:Game.cs


注:本文中的Form2.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。