本文整理汇总了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;
}
示例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);
}
}
示例3: experteneinstellungenToolStripMenuItem_Click
private void experteneinstellungenToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 expertenEinstellungen = new Form2();
expertenEinstellungen.TheParent = this;
expertenEinstellungen.ShowDialog();
}
示例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("کلمه عبور با شناسه مطابقت ندارد");
}
}
示例5: button3_Click
private void button3_Click(object sender, EventArgs e)
{
Form2 ff = new Form2();
this.Hide();
ff.ShowDialog();
ff.Close();
}
示例6: button1_Click
private void button1_Click(object sender, EventArgs e)
{
Form2 frmenglish = new Form2();
this.Hide();
frmenglish.ShowDialog();
this.Close();
}
示例7: throwError
public void throwError(string output)
{
Form2 errorWindow = new Form2(output);
errorWindow.ShowInTaskbar = false;
errorWindow.StartPosition = FormStartPosition.CenterScreen;
errorWindow.ShowDialog(this);
}
示例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();
}
示例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();
}
示例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); //указуємо хазяїна для форми
}
示例11: appointmentToolStripMenuItem_Click
private void appointmentToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Hide();
Form2 frm = new Form2();
frm.ShowDialog();
this.Show();
}
示例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();
}
}
示例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;
}
}
示例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();
}
示例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());
}