37.winform之panel

效果

实现


代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp7 {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e) {
            panel1.Visible = true;
        }

        private void button2_Click(object sender, EventArgs e) {
            panel1.Visible = false;
        }
    }
}

通过效果可以发现panel看不见,但是它是存在的,当我们隐藏panel时,panel中控件也隐藏了,当显示时,pannel中控件也显示了

posted @ 2020-05-27 21:58  兔子不会吃草  阅读(1508)  评论(0编辑  收藏  举报