本文整理汇总了C#中Form1.Close方法的典型用法代码示例。如果您正苦于以下问题:C# Form1.Close方法的具体用法?C# Form1.Close怎么用?C# Form1.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form1
的用法示例。
在下文中一共展示了Form1.Close方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
Form1 form1 = null;
MulticamLog.Open();
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bool done = false;
while (!done)
{
try
{
form1 = new Form1();
Application.Run(form1);
done = true;
}
catch (Exception e)
{
MulticamLog.Log(e);
MessageBox.Show("MultiCam encountered an unexpected problem, " +
"and will now close.\r\n" +
"Please accept our apologies!");
// Application.Restart() caused problems, so gave up on it.
form1.Close();
form1.ForceClosed = true;
Application.Exit();
MulticamLog.Log(0, "*********** MultiCam restarting ****************");
}
}
MulticamLog.Close();
}
示例2: btnUsers_Click
//private void Form1_Load(object sender, EventArgs e)
//{
// // TODO: esta línea de código carga datos en la tabla 'centroMedicoDataSet.Citas' Puede moverla o quitarla según sea necesario.
// this.citasTableAdapter.Fill(this.centroMedicoDataSet.Citas);
//}
private void btnUsers_Click(object sender, EventArgs e)
{
MantenimientoUsuarios mantenimientoUsers = new MantenimientoUsuarios();
mantenimientoUsers.Show();
Form1 form = new Form1();
form.Close();
}
示例3: button1_Click
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
Form1 fmr = new Form1();
fmr.Close();
}
示例4: button1_Click
private void button1_Click(object sender, EventArgs e)
{
Form1 f = new Form1();
f.Close();
this.Close();
Register r = new Register();
r.Show();
}
示例5: Main
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
Form1 tf = new Form1();
Thread ct = new Thread(
new ThreadStart(
delegate ()
{
while (true)
{
string command = Console.ReadLine();
switch (command)
{
case "close":
tf.Invoke(new MethodInvoker(
delegate ()
{
tf.Close();
}));
break;
case "max":
tf.Invoke(new MethodInvoker(
delegate ()
{
tf.WindowState = FormWindowState.Maximized;
}));
break;
case "min":
tf.Invoke(new MethodInvoker(
delegate ()
{
tf.WindowState = FormWindowState.Minimized;
}));
break;
case "res":
tf.Invoke(new MethodInvoker(
delegate ()
{
tf.WindowState = FormWindowState.Normal;
}));
break;
}
}
}));
ct.Start();
tf.Show();
tf.Activate();
Application.Run(tf);
Environment.Exit(0);
}
示例6: Main
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 form1 = new Form1();
form1.ShowDialog();
if (form1.DialogResult == DialogResult.OK)
{
form1.Close();
Application.Run(new Form2(form1.userName, form1.clientSocket));
}
}
示例7: btnIngresar_Click
private void btnIngresar_Click(object sender, EventArgs e)
{
bool login = DatabaseHelper.execSPLogin("Usuarios", txtUsuario.Text, txtContraseña.Text);
if (login)
{
Form1 inicio = new Form1();
MessageBox.Show("Bienvenido");
this.Hide();
inicio.ShowDialog();
inicio.Close();
this.Close();
}
else
{
MessageBox.Show("Verifica tus datos");
this.txtContraseña.Text = "";
this.txtUsuario.Text = "";
}
}
示例8: Play_Click
private void Play_Click(object sender, EventArgs e)
{
if (this.Player2Name.Text == "")
{
StartGame.Player1Name.Text = this.Player1Name.Text;
StartGame.Player2Name.Text ="COM";
Form1 OpenForm = new Form1();
this.Hide();
OpenForm.Close();
StartGame.Show();
}
else {
StartGame.Player1Name.Text = this.Player1Name.Text;
StartGame.Player2Name.Text = this.Player2Name.Text;
Form1 OpenForm = new Form1();
this.Hide();
OpenForm.Close();
StartGame.Show();
}
}
示例9: btLogin_KeyDown
private void btLogin_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string username = tbUsernameLogin.Text;
string password = cs.Encrypt(tbPasswordLogin.Text);
bool r = database.Login(username, password);
if (r)
{
Main main = new Main();
Form1 form1 = new Form1();
form1.Close();
main.Show();
}
else
{
MessageBox.Show("Incorrect Login Credentials");
}
}
}
示例10: Main
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
PXCMSession session = null;
session = PXCMSession.CreateInstance();
if (session != null)
{
// Optional steps to send feedback to Intel Corporation to understand how often each SDK sample is used.
PXCMMetadata md = session.QueryInstance<PXCMMetadata>();
if (md != null)
{
string sample_name = "Hands Viewer CS";
md.AttachBuffer(1297303632, System.Text.Encoding.Unicode.GetBytes(sample_name));
}
Form splash = new Form1();
splash.Show();
Thread.Sleep(3000);
splash.Close();
Application.Run(new MainForm(session));
session.Dispose();
}
}
示例11: toolFileExit_Click
private void toolFileExit_Click(object sender, EventArgs e)
{
Form1 form = new Form1();
this.Close();
form.Close();
Application.Exit();
}
示例12: Application
//.........这里部分代码省略.........
async scope =>
{
var page = new App.FromDocument();
Native.document.title += ">";
page.sizetarget.value = "";
page.sizetarget.disabled = true;
#region >
// Uncaught Error: InvalidOperationException: we can only continue with global methods for now... { Target = [object Object] }
// we could tread the page object special, if it is the only shared reference
//await 200;
#region Form1
var f = new Form1
{
Text = "Activity1 ",
BackColor = Color.Transparent
//BackColor = Color.FromArgb(20, 255, 255, 255)
};
__Form ff = f.AttachControlTo(page.content);
// this wont work with maximized mode yet?
//ff.ResizeGripElement.Show();
ff.HTMLTargetRef.style.bottom = "16px";
page.sizetarget.style.minWidth = f.Width + "px";
page.sizetarget.style.minHeight = (f.Height + 16) + "px";
f.ClientSizeChanged +=
delegate
{
page.sizetarget.style.minWidth = f.Width + "px";
page.sizetarget.style.minHeight = (f.Height + 16) + "px";
};
// remove the max blackness. the vista max.
ff.InternalStyler.CaptionShadow.style.backgroundColor = "";
ff.InternalStyler.Caption.style.backgroundColor = "";
// make it large. how large?
// liberation of inline style
ff.InternalStyler.CaptionContent.style.font = "";
ff.InternalStyler.CaptionContent.style.fontSize = "";
ff.InternalStyler.CaptionContent.style.lineHeight = "";
// magic
ff.InternalStyler.CaptionContent.style.height = "47px";
ff.CaptionForeground.style.height = "47px";
ff.InternalStyler.TargetOuterBorder.style.border = "";
ff.InternalStyler.TargetOuterBorder.style.boxShadow = "";
ff.InternalStyler.TargetOuterBorder.style.background = "linear-gradient(to bottom, rgba(0,0,0,0.9) 0%,rgba(0,0,0,0) 100%)";
#endregion
//await scope | f.FormClosed;
//var FormClosed = new TaskCompletionSource<Form>();
f.FormClosed += delegate { f = null; Native.window.history.back(); };
//await Task.WhenAny(scope, FormClosed);
await scope;
if (f != null)
f.Close();
#endregion
Native.document.title += "<";
page.sizetarget.value = scope.state.value;
page.sizetarget.disabled = false;
}
);
};
__page.sizetarget.value = "click to enter\n- or -\nclick forward to redu last step";
__page.sizetarget.style.color = "yellow";
__page.sizetarget.style.padding = "1em";
__page.sizetarget.style.textAlign = IStyle.TextAlignEnum.center;
// fist timer can auto enter!
if (Native.window.history.length < 2)
{
((IHTMLAnchor)(object)__page.sizetarget).click();
}
else
{
}
}
示例13: timer1_Tick
//timer run sources
private void timer1_Tick(object sender, EventArgs e)
{
if(gio>=0)
{
if(phut>=0)
{
if(giay>0)
{
giay--;
}
else
{
giay=59;
phut--;
}
}
else
{
phut=59;
gio--;
}
//this.textBox1.Text = gio.ToString();
//this.textBox2.Text = phut.ToString();
//this.textBox3.Text = giay.ToString();
this.button3.Text = gio.ToString() + ":" + phut.ToString() + ":" + giay.ToString();
}
if (gio == 0 && phut == 0 && giay == 0)
{
timer1.Stop();
// MessageBox.Show("Ket Thuc Thanh Cong","Configuration!");
Form3 frm = new Form3();
frm.Show();
Form1 fr = new Form1();
fr.Close();
ghichep();
button1.Enabled = true;
panel2.Hide();
checkBox1.Checked=false;
MP3Player nhac = new MP3Player();
nhac.Open("media.mp3");
nhac.Play(false);
textBox4.Enabled = true;
}
}
示例14: dinnou
public void dinnou(Form1 f)
{
f.Visible = false;
f.Close();
Main();
}
示例15: b_tab2_Click
private void b_tab2_Click(object sender, EventArgs e)
{
Form1 f1 = new Form1();
lblPicBGrootte f2 = new lblPicBGrootte();
f2.Show();
f1.Close();
}