달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2015. 3. 28. 14:57

Form attch to tabControl 카테고리 없음2015. 3. 28. 14:57


        void addTabPage(string pageName)

        {

            TabPage tabPage = new System.Windows.Forms.TabPage();

            tabPage.Paint += new PaintEventHandler(tabPage_Paint);

            tabPage.Name = pageName;

            tabPage.Text = pageName;

            tabPage.AutoScroll = true;

            Point location = new Point(0, 0);


            for(int i = 0 ;i  < 2; i++)

                addForm(tabPage, ref location);


           

            this.myTabControl.Controls.Add(tabPage);

        }

        void addForm(TabPage tabPage, ref Point location)

        {

            Form1 f = new Form1();

            

            f.Location = location;

            f.Size = new Size(this.tabPage1.ClientRectangle.Size.Width-5,this.tabPage1.ClientRectangle.Size.Height-5);

            f.BackColor = Color.Black;


            location.Y = f.ClientRectangle.Height + 5;


            

            f.TopLevel = false;

            f.FormBorderStyle = FormBorderStyle.None;

            //f.Dock = DockStyle.Fill;

            

            tabPage.Controls.Add(f);

            f.Visible = true;

        }


tabControl 스크롤 하면 MDI폼의 Graphic 객체가 무효화되지 않는다.


r

:
Posted by НooпeУ


Code Start Code End