当我们处理另一种表单时,如何在C#GUI中隐藏表单 [英] how to hide a form in C# GUI when we are working on another form

查看:72
本文介绍了当我们处理另一种表单时,如何在C#GUI中隐藏表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们单击新表单时如何隐藏以前的表单.
我使用HIDE()属性进行了尝试.即使要使用它,它也不能告诉我在哪里使用.

How to hide the previous form when we click on new form.
I tried it by using HIDE() property.Its not working pls guide me even if it is to be used tell me where to use it.

推荐答案

成员HIDE(),并且这样的成员将是方法,而不是属性.

有一种方法Hide(),它始终有效.我不知道你到底搞错了什么;有很多方法可以做到这一点. :-)

-SA
There is no member HIDE(), and such member would be a method, not a property.

There is a method Hide(), it always work. I don''t know what exactly you screw up; there are many ways to do so. :-)

—SA


表单示例.

example of a form.

public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            Button button1 = new Button();
            button1.Text = "Click Me";
            button1.Click += new System.EventHandler(this.button1_Click);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();

            Form f = new Form();
            f.Closed += new EventHandler(f_Closed);
            f.Show();
        }

        void f_Closed(object sender, EventArgs e)
        {
            this.Show();
        }
    }


这篇关于当我们处理另一种表单时,如何在C#GUI中隐藏表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆