Esempio n. 1
0
 //PRB: Exception thrown during Windows Forms data binding if bound control is on a tab page with uncreated handle
 //FIX: Make sure all tab pages are created when the tabcontrol is created.
 //https://connect.microsoft.com/VisualStudio/feedback/details/351177
 private void InitializeTabPage(System.Windows.Forms.TabPage page_, bool createHandle_, bool createControl_)
 {
     if (!createControl_ && !createHandle_)
     {
         return;
     }
     if (createHandle_ && !page_.IsHandleCreated)
     {
         IntPtr handle = page_.Handle;
     }
     if (!page_.Created && createControl_)
     {
         return;
     }
     bool visible = page_.Visible;
     if (!visible)
     {
         page_.Visible = true;
     }
     page_.CreateControl();
     if (!visible)
     {
         page_.Visible = false;
     }
 }