2010-12-21 4 views
1

내 타블렛이이 양식에 표시되지 않는 이유를 아는 사람이 있습니까? 느낌이 어쩌면 간단하지만 순간 나는 그냥 빈 양식을 얻을.TabControl winform C#

감사

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

namespace test_project_3 
{ 
    public partial class TabTest : Form 
    { 
     public TabTest() 
     { 
      InitializeComponent(); 

      WebBrowser WB = new WebBrowser(); 
      WB.Navigate("www.google.com"); 

      TabControl tc = new TabControl(); 
      tc.Dock = DockStyle.Fill; 
      tc.Show(); 

      TabPage tp = new TabPage(); 
      tp.Text = "test"; 
      tp.Show(); 
      tp.Controls.Add(WB); 

      tc.TabPages.Add(tp); 
     } 
    } 
} 

답변

2

당신은 TabControlControls 컬렉션에 추가해야합니다

this.Controls.Add(tc); 
+0

감사 클라우스 - 마지막 10 분 동안 나를 미치게되었다! – Steve

+0

@ 스티브, hehe, 환영합니다 :-) –