C#/C# Winform

Winform_Modeless, Modal, MdiParent(폼안에 창이 밖으로 안나가게 하는 방법)

S_pot 2021. 6. 2. 17:48
 public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            IsMdiContainer = true;  
        }

        class Smart : Form
        {
            public Smart()
            {
                Text = "스마트 클래스의 폼 창 만들기";
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Smart aSmart = new Smart();
             //aSmart.MdiParent = this;    // 폼안에 창이 밖으로 나가지 않게 만들어준다.
             // aSmart.Show();       // Modeless 창
            aSmart.ShowDialog();    // Modal 창을 만들어준다.
        }
    }
댓글수0