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


C# Form2类代码示例

本文整理汇总了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();
 }
开发者ID:shreyans4nahata,项目名称:dairy_mgmt,代码行数:7,代码来源:retailerplantorder.cs

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

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

示例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!");
     }
 }
开发者ID:JamieFletcher92,项目名称:Year1BallBreakerGame,代码行数:25,代码来源:Settings.cs

示例5: start_Click

 private void start_Click(object sender, EventArgs e)
 {
     this.Hide();
     Form2 form2 = new Form2();
     form2.ShowDialog();
     this.Close();
 }
开发者ID:neilinglese,项目名称:Caves_of_Bowden_winForms,代码行数:7,代码来源:Form1.cs

示例6: btnNovaForma_Click

        private void btnNovaForma_Click(object sender, EventArgs e)
        {
            Form2 temp = new Form2();

            temp.ControlBox = false;
            temp.Show();
        }
开发者ID:humra,项目名称:Practice,代码行数:7,代码来源:Form1.cs

示例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;
        }
开发者ID:michaelfivez,项目名称:IntelligentPolicePlayer,代码行数:31,代码来源:Form1.cs

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

示例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 = "いや ファイルがだめだ!";
            }
        }
开发者ID:nopopopopon,项目名称:winHello1,代码行数:29,代码来源:Form1.cs

示例10: 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

示例11: Form1

        public Form1()
        {
            InitializeComponent();

            form2 = new Form2(this);
            form2.Visible = true;
        }
开发者ID:PrinceFroggy,项目名称:illuminati,代码行数:7,代码来源:Form1.cs

示例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");
            }
        }
开发者ID:karthikeyan93,项目名称:mypro,代码行数:26,代码来源:Form1.cs

示例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;
 }
开发者ID:dioptre,项目名称:nkd,代码行数:7,代码来源:ReportDesigner.cs

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

示例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";
        }
开发者ID:Seniority,项目名称:TicTacToe,代码行数:28,代码来源:Form1.cs


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