本文整理汇总了C#中Form2.Close方法的典型用法代码示例。如果您正苦于以下问题:C# Form2.Close方法的具体用法?C# Form2.Close怎么用?C# Form2.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form2
的用法示例。
在下文中一共展示了Form2.Close方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button3_Click
private void button3_Click(object sender, EventArgs e)
{
Form2 ff = new Form2();
this.Hide();
ff.ShowDialog();
ff.Close();
}
示例2: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
Form2 Form2 = new Form2();
Form2.Show();
Thread.Sleep(1000);
Form2.Close();
}
示例3: button1_Click
private void button1_Click(object sender, EventArgs e)
{
textBox1.Visible = false;
Form1 f1 = new Form1();
f1.ShowDialog();
Form2 g = new Form2();
g.Close();
ActiveForm.Close(); //Close();
}
示例4: button2_Click
private void button2_Click(object sender, EventArgs e)
{
Form2 fm2 = new Form2();
if (fm2.ShowDialog() == DialogResult.OK)
{
textBox1.Font = fm2.f;
textBox1.ForeColor = fm2.c;
}
fm2.Close();
fm2.Dispose();
}
示例5: Class1
public Class1()
{
/* Adds the event and the event handler for the method that will
process the timer event to the timer. */
myTimer.Tick += new EventHandler(TimerEventProcessor);
// Sets the timer interval to 5 seconds.
myTimer.Interval = 5000;
f=new Form2();
f.Show();
myTimer.Start();
// Runs the timer, and raises the event.
while(exitFlag == false)
{
Application.DoEvents();
// Processes all the events in the queue.
}
f.Close();
//return 0;
}
示例6: button2_Click
private void button2_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.f1 = this;
f2.Show();
this.Hide();
var bar = f2.GetProcess();
ReName.Init(textBox4.Text, filename.Text, source_dir.Text, target_dir.Text, time.Checked);
bar.Minimum = 1;
bar.Maximum = ReName.GetTaskCount();
bar.Value = 1;
bar.Step = 1;
ReName.onRenameCompleted += (x,y)=> bar.PerformStep();
ReName.onCompleted += () =>
{
f2.Close();
this.Show();
};
ReName.Run();
}
示例7: setSeedToolStripMenuItem_Click
private void setSeedToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
f2.ShowDialog();
if (f2.new_seed != null)
seed = f2.new_seed;
f2.Close();
}
示例8: button1_Click
//.........这里部分代码省略.........
Form2 form2 = new Form2();
form2.Show();
this.button1.Enabled = false;
this.button2.Enabled = false;
Spreadsheet sheet = new Spreadsheet(USERNAME, PASSWORD);
try {
// ログイン設定
sheet.setUser();
// シート取得
string feedURI = context.feedURI;
foreach (Key key in context.keys) {
string uri = feedURI + key.feedKey;
form2.strParam = uri + "\r\nフィードを取得中...\r\n";
CellFeed cellFeed = sheet.fetch(uri);
if (cellFeed == null) {
MessageBox.Show(uri + "\r\nスプレッドシートがありません。");
break; // abort
}
// stringtable_original.xmlコピー
string originalFileName = configDirPath + "\\stringtable_" + key.ID + ".xml";
string destFileName = Directory.GetCurrentDirectory() + "\\(" + key.ID + ")" +"stringtable.xml";
if (!File.Exists(destFileName)) {
File.Copy(originalFileName, destFileName);
}
// 中間ファイル作成
using (FileStream fs = new FileStream(tempFilename, FileMode.Append, FileAccess.Write)) {
A3JPXmlCreator xmlTemp = new A3JPXmlCreator(fs);
string missionID = key.ID;
xmlTemp.StartTempFile(missionID);
// Iterate through each cell, printing its value.
foreach (CellEntry cell in cellFeed.Entries) {
xmlTemp.WriteTempFile(cell.Column, cell.Value);
}
xmlTemp.EndTempFile();
}
form2.strParam = "\r\nstringtable.xml を作成中...\r\n\r\n";
// 置換
A3JPXmlCreator xmlStringtable = new A3JPXmlCreator(destFileName);
XmlTextReader source = new XmlTextReader(tempFilename);
while (source.Read()) {
string id = "";
string p = "";
source.MoveToContent();
if (source.NodeType == XmlNodeType.Element && source.HasAttributes) {
source.MoveToAttribute("ID");
id = source.Value; // <Key ID="" />
source.MoveToElement();
for (int i = 0; i < 4; ++i) {
// ノード進める
source.Read();
source.MoveToContent();
}
p = source.ReadString(); // <English></English>
// stringtable.xml 置換
xmlStringtable.ReplaceText(id, p);
}
}
source.Close();
xmlStringtable.Save();
// 中間ファイル削除
if (File.Exists(tempFilename)) {
File.Delete(tempFilename);
}
} // foreach (Key key in context.keys)
form2.strParam = "終了しました。";
} catch (InvalidCredentialsException ex) {
// 認証エラー
MessageBox.Show(ex.Message + "\r\nログインできません。");
form2.Close();
} catch (GDataRequestException ex) {
// リクエストエラー
MessageBox.Show(ex.Message + "\r\nフィードが取得できません。プログラムを終了します。");
this.Close();
} catch (Exception ex) {
MessageBox.Show(ex.Message + "\nプログラムを終了します。");
this.Close();
} finally {
this.button1.Enabled = true;
this.button2.Enabled = true;
// 中間ファイル削除
if (File.Exists(tempFilename)) {
File.Delete(tempFilename);
}
}
}
示例9: contrast_Click
private void contrast_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2();
frm2.ShowDialog();
string constr = "";
if (frm2.DialogResult == DialogResult.OK)
{
constr = frm2.tran;
frm2.Close();
}
if (curBitmap != null)
{
Color c;
Bitmap temp = new Bitmap(curBitmap);
Bitmap bmap = (Bitmap)temp.Clone();
double contrast = Convert.ToInt32(constr);
if (contrast < -100)
{
contrast = -100;
}
if (contrast > 100)
{
contrast = 100;
}
contrast = (100.0 + contrast) / 100.0;
contrast *= contrast;
for (int i = 0; i < bmap.Width; i++)
{
for (int j = 0; j < bmap.Height; j++)
{
c = bmap.GetPixel(i, j);
double pR = c.R / 255.0;
pR -= 0.5;
pR *= contrast;
pR += 0.5;
pR *= 255;
if (pR < 0)
{
pR = 0;
}
if (pR > 255)
{
pR = 255;
}
double pG = c.G / 255.0;
pG -= 0.5;
pG *= contrast;
pG += 0.5;
pG *= 255;
if (pG < 0)
{
pG = 0;
}
if (pG > 255)
{
pG = 255;
}
double pB = c.B / 255.0;
pB -= 0.5;
pB *= contrast;
pB += 0.5;
pB *= 255;
if (pB < 0)
{
pB = 0;
}
if (pB > 255)
{
pB = 255;
}
bmap.SetPixel(i, j, Color.FromArgb((byte)pR, (byte)pG, (byte)pB));
}
//Invalidate();
}
Invalidate();
pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;
this.pictureBox2.Image = bmap;
curBitmap = bmap;
this.pictureBox2.Refresh();
}
}
示例10: verifySAM
//SAM認證
void verifySAM()
{
//if (checkSAMStatus() == true)
//{
// msg("讀卡機認證成功。");
// m_IsSAMChecked = true;
// label3.Text = "讀卡機認證狀態:已認證";
// return;
//}
//openCom();
Form2 f2 = new Form2();
f2.showMessage("與健保局連線認證中,請稍後...");
f2.Show();
Application.DoEvents();
this.Cursor = Cursors.WaitCursor;
nErrCode = csVerifySAMDC();
f2.Close();
f2.Dispose();
this.Cursor = Cursors.Default;
if (nErrCode == 0)
{
msg("讀卡機認證成功。");
m_IsSAMChecked = true;
label3.Text = "讀卡機認證狀態:已認證";
}
else
{
msg("讀卡機認證失敗" + "\r\n" + "錯誤訊息:" + ErrCode.errMsg(nErrCode));
}
//closeCom();
}
示例11: findKeyToolStripMenuItem_Click
private void findKeyToolStripMenuItem_Click(object sender, EventArgs e)
{
Form frm = new Form2();
frm.Icon = this.Icon;
frm.ShowDialog();
frm.Close();
frm = null;
}
示例12: toolBtnInfo_Click
private void toolBtnInfo_Click(object sender, EventArgs e)
{
Form2 frmAbout = new Form2();
DialogResult drResult = frmAbout.ShowDialog(this);
if (drResult == DialogResult.OK)
{
frmAbout.Close();
}
else
{
Close();
}
}
示例13: Form1
public Form1()
{
Form2 f2 = new Form2();
f2.Show();//show出欢迎窗口
System.Threading.Thread.Sleep(2000);//欢迎窗口停留时间2s
f2.Close();//关闭欢迎窗口并开始运行主窗口
InitializeComponent();
System.Timers.Timer t = new System.Timers.Timer(100);
t.Elapsed += new System.Timers.ElapsedEventHandler(refresh);
t.AutoReset = true;
t.Enabled = true;
}
示例14: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
label4.Hide();
this.Hide();
Form2 loading = new Form2();
loading.Show();
loading.Update();
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Dictionary<string, decimal> cRates = null;
try {
cRates = initData();
}
catch (WebException ex) {
MessageBox.Show("O conexiune activă la internet este necesară pentru a obține cursul valutar!", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (!db.DBexists()) {
Environment.Exit(-1);
}
cRates = initData_wo_internet();
}
c.conversionRates = cRates;
db_currencies = getDBCurrencies();
aux = getDBCurrencies();
int euro_pos = new int();
int usd_pos = new int();
int i = 0;
comboBox1.Items.Add(RON_NAME);
comboBox2.Items.Add(RON_NAME);
foreach(var currency in db_currencies){
comboBox1.Items.Add(currency.Value);
comboBox2.Items.Add(currency.Value);
checkedListBox1.Items.Add(currency.Value);
s_currencies.Add(currency.Key, new Series());
s_currencies[currency.Key].Name = currency.Key;
s_currencies[currency.Key].ChartType = SeriesChartType.Line;
if ("EUR" == currency.Key) {
euro_pos = i+1;
}
if ("USD" == currency.Key) {
usd_pos = i;
}
i++;
}
db_currencies.Add(RON, RON_NAME);
comboBox1.SelectedIndex = euro_pos;
comboBox2.SelectedIndex = 0;
checkedListBox1.CheckOnClick = true;
checkedListBox1.SetItemChecked(euro_pos - 1, true);
checkedListBox1.SetItemChecked(usd_pos, true);
textBox2.Text = "24";
textBox1.Text = "1";
dateTimePicker1.MaxDate = DateTime.Today;
dateTimePicker2.MaxDate = DateTime.Today;
dateTimePicker3.MaxDate = DateTime.Today;
dateTimePicker2.Value = DateTime.Today.AddDays(-14);
populate_chart(chart1, s_currencies["USD"], DateTime.Now, DateTime.Now.AddDays(-14));
tabControl1.SelectedIndex = 0;
this.Size = new System.Drawing.Size(760, 185);
tabControl1.Size = new System.Drawing.Size(750, 175);
statusStrip1.Visible = false;
chart1.ChartAreas[0].AxisY.Title = RON;
chart1.ChartAreas[0].AxisX.Title = "Data";
chart1.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
chart1.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
loading.Close();
this.Visible = true;
}