Exemplo n.º 1
0
        /// <summary>
        /// 탭페이지 추가하기
        /// </summary>
        /// <param name="pageTitle">페이지의 상단에 들어갈 타이틀</param>
        /// <param name="container">탭페이지에 들어갈 컨트롤들을 담고 있는 컨테이너컨트롤(패널 등)</param>
        public void AddTabPage(string pageTitle, Control container)
        {
            if (CheckTabPages(this, pageTitle))
            {
                //이미 존재하는 경우
                return;
            }

            myTabPage tp = new myTabPage();

            tp.Controls.Add(container);
            tp.Text = pageTitle;

            container.Visible    = true;
            container.Dock       = DockStyle.Fill;
            tp.AutoScroll        = true;
            tp.AllowDrop         = true;
            tp.Height            = tp.Controls[0].Height;
            tp.Controls[0].Width = tp.Width;
            tp.Show();
            this.TabPages.Add(tp);

            //첫번째 탭 페이지는 기본적으로 보여지는 탭 페이지 이므로 이를 선택된 탭 페이지로 본다
            this.SelectedIndex = 0;
        }
Exemplo n.º 2
0
        /// <summary>
        /// �������� �߰��ϱ�
        /// </summary>
        /// <param name="pageTitle">�������� ��ܿ� �� Ÿ��Ʋ</param>
        /// <param name="container">���������� �� ��Ʈ�ѵ��� ��� �ִ� �����̳���Ʈ��(�г� ��)</param>
        public void AddTabPage(string pageTitle, Control container)
        {
            if (CheckTabPages(this, pageTitle))
            {
                //�̹� �����ϴ� ���
                return;
            }

            myTabPage tp = new myTabPage();
            tp.Controls.Add(container);
            tp.Text = pageTitle;

            container.Visible = true;
            container.Dock = DockStyle.Fill;
            tp.AutoScroll = true;
            tp.AllowDrop = true;
            tp.Height = tp.Controls[0].Height;
            tp.Controls[0].Width = tp.Width;
            tp.Show();
            this.TabPages.Add(tp);

            //ù��° �� �������� �⺻������ �������� �� ������ �̹Ƿ� �̸� ���õ� �� �������� ����
            this.SelectedIndex = 0;
        }