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


C# Form2.Hide方法代码示例

本文整理汇总了C#中Form2.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# Form2.Hide方法的具体用法?C# Form2.Hide怎么用?C# Form2.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Form2的用法示例。


在下文中一共展示了Form2.Hide方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Form1

 public Form1()
 {
     initStreamWriter();
        form2 = new Form2(this, streamWriter);
        form2.Hide();
        InitializeComponent();
 }
开发者ID:garciad7,项目名称:health-records-project,代码行数:7,代码来源:Form1.cs

示例2: Main

 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Form2 f2 = new Form2();
     f2.Hide();
     Application.Run(new Form1());
     Application.Run(f2);
 }
开发者ID:rkalwak,项目名称:YoutubePlayer,代码行数:9,代码来源:Program.cs

示例3: button2_Click

        private void button2_Click(object sender, EventArgs e)
        {
            Form2 f = new Form2();

            f.Show();
            f.Hide();

            if (checkBox1.Checked == true)
            {
                if (label6.Text != "<未选择>")//判断图标是否选择
                    f.Icon = new Icon(label6.Text);//通过label6也就是选择的文件的路径设置窗口图标
                else MessageBox.Show("您还没有选择图标!");//处理错误
            }

            if (checkBox2.Checked == true)
            {
                if (label9.Text != "<未选择>")//判断图片是否选择
                    f.BackgroundImage = Image.FromFile(label9.Text);//通过label9也就是选择的文件的路径设置窗口背景
                else MessageBox.Show("您还没有选择图片!");//处理错误
                //上面更改背景///////////////////////////////下面更改样式
                if (radioButton1.Checked)
                    f.BackgroundImageLayout = ImageLayout.None;
                else if (radioButton2.Checked)
                    f.BackgroundImageLayout = ImageLayout.Tile;
                else if (radioButton3.Checked)
                    f.BackgroundImageLayout = ImageLayout.Center;
                else if (radioButton4.Checked)
                    f.BackgroundImageLayout = ImageLayout.Stretch;
                else if (radioButton5.Checked)
                    f.BackgroundImageLayout = ImageLayout.Zoom;
            }
            
            if (checkBox3.Checked == true)
                f.Text = textBox1.Text;//修改窗口标题为textbox1的文本

            if (checkBox4.Checked == true)
            {
                try//测试是否可以转换
                {
                    int width = int.Parse(textBox2.Text);//转换数字
                    int height = int.Parse(textBox3.Text);//转换数字
                    f.Width = width;//设置窗口宽度
                    f.Height = height;//设置窗口高度
                }
                catch
                {
                    MessageBox.Show("请输入整数!");//处理错误
                }
            }

            f.Show();

        }
开发者ID:dtsdao,项目名称:ZBTool,代码行数:53,代码来源:Form1.cs

示例4: Form1

        public Form1()
        {
            InitializeComponent();

            this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - this.Width, 0);
            this.Height = Screen.PrimaryScreen.WorkingArea.Height;

            hotSpotX = Screen.PrimaryScreen.Bounds.Width - 10;
            hotAreaX = Screen.PrimaryScreen.Bounds.Width - this.Width;

            this.Opacity = 0.0f;
            this.Hide();

            Random r = new Random();

            Image poster = Image.FromFile("poster.jpg");

            hovering = false;

            Timer t = new Timer();
            t.Interval = 25;
            t.Tick += new EventHandler(t_Tick);
            t.Start();

            for (int i = 0; i < 100; i++)
            {
                switch(r.Next(0, 2))
                {
                    case 0:
                        TextBox tb = new TextBox();
                        tb.Size = new Size(100, 100);
                        tb.Multiline = true;
                        tb.Margin = new Padding(20);
                        for (int j = 0; j < r.Next(5, 50); j++)
                        {
                            tb.Text += "Teste " + j;
                            tb.Text += r.Next(0, 2) == 1 ? "\n" : "";
                        }
                        tb.MouseEnter += new EventHandler(tb_MouseHover);
                        tb.MouseLeave += new EventHandler(tb_MouseLeave);
                        flowLayoutPanel1.Controls.Add(tb);
                    break;

                    case 1:
                        PictureBox pb = new PictureBox();
                        pb.Size = new Size(100, 100);
                        pb.Location = new Point(20, (i * 100) + 20);
                        pb.Margin = new Padding(20);
                        pb.SizeMode = PictureBoxSizeMode.StretchImage;
                        pb.Image = poster;
                        pb.MouseEnter += new EventHandler(pb_MouseHover);
                        pb.MouseLeave += new EventHandler(pb_MouseLeave);
                        flowLayoutPanel1.Controls.Add(pb);
                    break;
                }
            }

            hoverForm = new Form2();
            hoverForm.Hide();
            hoverForm.TopMost = true;
        }
开发者ID:ngaspar,项目名称:windows-floating-panel-stress-test,代码行数:61,代码来源:Form1.cs

示例5: ShowForm

 public void ShowForm(Form2 form)
 {
     this.Show();
     form.Hide();
 }
开发者ID:RWB01,项目名称:System-of-artificial-intelligence,代码行数:5,代码来源:Form1.cs

示例6: updateDB_Click

        private void updateDB_Click(object sender, EventArgs e)
        {
            this.Hide();
            Form2 loading = new Form2();
            loading.Show();
            loading.Update();

            try {
                get10DaysData();
            }
            catch (WebException ex) {
                MessageBox.Show("O conexiune activă la internet este necesară pentru a obține cursul valutar!", "Eroare", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            loading.Hide();
            this.Show();
        }
开发者ID:paulbarbu,项目名称:moneystock,代码行数:17,代码来源:Form1.cs


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