本文整理汇总了C#中Form2类的典型用法代码示例。如果您正苦于以下问题:C# Form2类的具体用法?C# Form2怎么用?C# Form2使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Form2类属于命名空间,在下文中一共展示了Form2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button1_Click
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
var form = new Form2();
form.Closed += (s, args) => this.Close();
form.Show();
}
示例2: listView1_SelectedIndexChanged
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();
}
示例3: button1_Click
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());
}
示例4: buttonDone_Click
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!");
}
}
示例5: start_Click
private void start_Click(object sender, EventArgs e)
{
this.Hide();
Form2 form2 = new Form2();
form2.ShowDialog();
this.Close();
}
示例6: btnNovaForma_Click
private void btnNovaForma_Click(object sender, EventArgs e)
{
Form2 temp = new Form2();
temp.ControlBox = false;
temp.Show();
}
示例7: initializeBrain
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;
}
示例8: button1_Click
private void button1_Click(object sender, EventArgs e)
{
m = panel1.CreateGraphics();
m.DrawRectangle(pen, 20, 20, 20, 20);
Form2 n = new Form2();
n.Show();
}
示例9: button1_Click
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 = "いや ファイルがだめだ!";
}
}
示例10: throwError
public void throwError(string output)
{
Form2 errorWindow = new Form2(output);
errorWindow.ShowInTaskbar = false;
errorWindow.StartPosition = FormStartPosition.CenterScreen;
errorWindow.ShowDialog(this);
}
示例11: Form1
public Form1()
{
InitializeComponent();
form2 = new Form2(this);
form2.Visible = true;
}
示例12: button1_Click
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='" + textBox1.Text + "'and password='" + textBox2.Text + "'", 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");
}
}
示例13: barSubItem15_ItemClick
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;
}
示例14: b_Click
void b_Click(object sender, EventArgs e)
{
WinPcapDevice device = (WinPcapDevice)((Button)sender).Tag;
Form2 form = new Form2();
form.Run(device);
form.Show(this);
}
示例15: changePlayersToolStripMenuItem_Click
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";
}