title: Forms in Tab control
body: <p>IDE: VB.NET (2008)</p>
  
  <p>I have an mdi form in my program. As usual this mdi form acts like a container to several child forms. However, I need to implement a tabbed system so that my forms rather than appearing in mdi form should appear in a tab page. </p>
  
  <p>So I inserted a tab control on my mdi form and when a form is added I say TabPage1.Controls.Add(Form). It seems to be working okay until I found out that now my form is like a control so methods like Me.GetActiveMDIChild etc won't work.</p>
  
  <p>Is there any I can solve two problems : </p>
  
  <ul>
  <li><p>Generally when a particular child form is selected we can know when we see the titlebar. In this case because forms are added as controls there is no difference in the titlebar of a selected or non selected form. Is there a way to fix this ?</p></li>
  <li><p>Can I determine which form is selected. Something like Me.ActiveMdiChild. I can go through control collection of a tab page to get a list of forms but figuring out which form is selected is something I don't know.</p></li>
  </ul>
  
  <p>Any help will be appreciated. </p>
  
  <p>Thanks a lot,</p>
  
  <p>Cheers,
  GR</p>