<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : TabControl.InsertItem</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : TabControl.InsertItem]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 12 May 2026 22:09:17 +0000</pubDate>
  <lastBuildDate>Sun, 31 Jul 2016 15:49:56 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=10834</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[TabControl.InsertItem : Years later I was with the same...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=74926&amp;title=tabcontrol-insertitem#74926</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3733">Krog</a><br /><strong>Subject:</strong> 10834<br /><strong>Posted:</strong> 31 July 2016 at 3:49pm<br /><br />Years later I was with the same problem and I found this thread with my own comments! I didn't even remember of them.<div><br></div><div>Well, I solved it using a Codejock GroupBox with Transparent=True (<span style="line-height: 16.8px;">and removing the Caption and with no borders</span><span style="line-height: 1.4;">) on top of the TabControlPage</span></div><div><br></div><div>It works like a charm</div>]]>
   </description>
   <pubDate>Sun, 31 Jul 2016 15:49:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=74926&amp;title=tabcontrol-insertitem#74926</guid>
  </item> 
  <item>
   <title><![CDATA[TabControl.InsertItem :   Hi Jean &amp;amp; Krog,I stumbled...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=58379&amp;title=tabcontrol-insertitem#58379</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2960">Xander75</a><br /><strong>Subject:</strong> 10834<br /><strong>Posted:</strong> 09 May 2010 at 4:08am<br /><br />Hi Jean &amp; Krog,<br><br>I stumbled across this post recently as I looked for an answer here in the forums, I know this is a bit late in the day from when you originally posted but I have found a solution and thought I should share it.<br><br>I too faced the issue with using the TabControlPage but I manged to find a solution that allows you to add new Tabs dynamically and any controls, in my case I was using the ReportControl.<br><br>The solution is to avoid using the TabControlPage and instead use a PictureBox as the container, I also avoid using the SetParent API. Please see the code below and the attached sample project for the solution.<br><br>Code Preview:<br><br><font color="#000099">Dim</font> lIndex <font color="#000099">As Long</font><br><br><font color="#000099">Private Sub</font> Command1_Click()<br>&nbsp;&nbsp;&nbsp; <font color="#006600">' Increment the lIndex variable</font><br>&nbsp;&nbsp;&nbsp; lIndex = lIndex + 1<br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <font color="#006600">' Load a new picReport Container and rpcReport ReportControl</font><br>&nbsp;&nbsp;&nbsp; Load picReport(lIndex)<br>&nbsp;&nbsp;&nbsp; Load rpcReport(lIndex)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <font color="#006600">' Insert the picReport Container into a new tab</font><br>&nbsp;&nbsp;&nbsp; tabReport.InsertItem lIndex, "New " &amp; lIndex, picReport(lIndex).hWnd, 0<br>&nbsp;&nbsp;&nbsp; tabReport.SelectedItem = lIndex<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <font color="#006600">' Set the rpcReport ReportControl container to be the picReport Container</font><br>&nbsp;&nbsp;&nbsp; <font color="#000099">Set </font>rpcReport(lIndex).Container = picReport(lIndex)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <font color="#006600">' Resize the rpcReport ReportControl to fit the picReport Container</font><br>&nbsp;&nbsp;&nbsp; rpcReport(lIndex).Move 0, 0, picReport(lIndex).Width, picReport(lIndex).Height<br>&nbsp;&nbsp;&nbsp; rpcReport(lIndex).Visible = <font color="#000099">True</font><br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <font color="#006600">' Add Column Configs</font><br>&nbsp;&nbsp;&nbsp; <font color="#000099">Dim </font>Column <font color="#000099">As </font>ReportColumn<br>&nbsp;&nbsp;&nbsp; <font color="#000099">Set </font>Column = rpcReport(lIndex).Columns.Add(0, "Name", 200, <font color="#000099">True</font>)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <font color="#006600">' Add Data to Grid</font><br>&nbsp;&nbsp;&nbsp; <font color="#000099">Dim </font>Record <font color="#000099">As </font>ReportRecord<br>&nbsp;&nbsp;&nbsp; <font color="#000099">Set </font>Record = rpcReport(lIndex).Records.Add<br>&nbsp;&nbsp;&nbsp; Record.AddItem "Grid " &amp; <font color="#000099">CStr</font>(lIndex)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <font color="#006600">' Refresh the rpcReport ReportControl</font><br>&nbsp;&nbsp;&nbsp; rpcReport(lIndex).Populate<br><font color="#000099">End Sub</font><br><br>I hope this helps someone...<br><br><a href="uploads/20100509_041040_DynamicTabs_.zip" target="_blank">uploads/20100509_041040_DynamicTabs_.zip</a><br>]]>
   </description>
   <pubDate>Sun, 09 May 2010 04:08:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=58379&amp;title=tabcontrol-insertitem#58379</guid>
  </item> 
  <item>
   <title><![CDATA[TabControl.InsertItem : I was testing a workaround using...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=54549&amp;title=tabcontrol-insertitem#54549</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3733">Krog</a><br /><strong>Subject:</strong> 10834<br /><strong>Posted:</strong> 04 November 2009 at 12:48am<br /><br />I was testing a workaround using an array of TabControlPages using the Index property at design time but a bug occurs and no one control is displayed, and only one TabControlPage is displayed, empty.<br /><br />The solution was:<br />-not to use the Index property at design time to create the array;<br />-use an array in the code and assign it at run-time, like this:<br /><br /><font face="Courier New, Courier, mono"><font color=BLUE>Dim TabCtlPage() As TabControlPage<br /><br />Private Sub Form_Load()<br /> Dim i As Integer<br /><br />  ReDim TabCtlPage(0 To 5)<br />  Set TabCtlPage(0) = TabControlPage1<br />  Set TabCtlPage(1) = TabControlPage2<br />  Set TabCtlPage(2) = TabControlPage3<br />  Set TabCtlPage(3) = TabControlPage4<br />  Set TabCtlPage(4) = TabControlPage5<br />  Set TabCtlPage(5) = TabControlPage6<br /></font><font color=GREEN><br />  ' The tabs that are not being used, we hide:</font><font color=BLUE><br />  TabControl1.Item(3).Visible = False<br />  TabControl1.Item(4).Visible = False<br />  TabControl1.Item(5).Visible = False<br /><br />End Sub</font></font><br /><br />But I am still preferring to create the TabControlPages at run-time and use an array. So the solution is welcome.<br />]]>
   </description>
   <pubDate>Wed, 04 Nov 2009 00:48:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=54549&amp;title=tabcontrol-insertitem#54549</guid>
  </item> 
  <item>
   <title><![CDATA[TabControl.InsertItem : Hi!  I would like to use the TabControlPage...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=54548&amp;title=tabcontrol-insertitem#54548</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3733">Krog</a><br /><strong>Subject:</strong> 10834<br /><strong>Posted:</strong> 04 November 2009 at 12:04am<br /><br />Hi!<br /><br />I would like to use the TabControlPage for the same purpose and I am getting the same problem.<br /><br />I am using the following line instead of SetParent:<br /><br /><table width="99%"><tr><td><pre class="BBcode">Set Text1(TxtCount).Container = TabControlPage1(TabCount)</pre></td></tr></table><br />How can I solve it?<br /><br />Note: I don't want to do the TabControlPage work and also I want the TabControlPage background that we don't get using a frame or picturebox... And the TabControlPages may be created at runtime.<br /><br />Can someone help me?<br />]]>
   </description>
   <pubDate>Wed, 04 Nov 2009 00:04:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=54548&amp;title=tabcontrol-insertitem#54548</guid>
  </item> 
  <item>
   <title><![CDATA[TabControl.InsertItem : This seems to work. Thank you!Now...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=36015&amp;title=tabcontrol-insertitem#36015</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2575">Jean</a><br /><strong>Subject:</strong> 10834<br /><strong>Posted:</strong> 30 May 2008 at 5:47am<br /><br />This seems to work. Thank you!<br>Now I have to write code to do what I thought the TabControl is doing. <img src="http://forum.codejock.com/smileys/smiley36.gif" border="0" align="absmiddle"><br>But I guess the TabControl+TabControlPages have not been developped for my "special case". <img src="http://forum.codejock.com/smileys/smiley9.gif" border="0" align="absmiddle"><br>]]>
   </description>
   <pubDate>Fri, 30 May 2008 05:47:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=36015&amp;title=tabcontrol-insertitem#36015</guid>
  </item> 
  <item>
   <title><![CDATA[TabControl.InsertItem : Hello,  You can try avoid using...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=36008&amp;title=tabcontrol-insertitem#36008</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 10834<br /><strong>Posted:</strong> 30 May 2008 at 4:53am<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>You can try avoid using&nbsp; TabControlPage, just add new controls to form/tabcontol and show/hide them if user change selected tab</DIV><DIV>&nbsp;</DIV><DIV>tabControl.InsertItem tabControl.ItemCount, "New " &amp; tabControl.ItemCount, 0, 0</DIV><DIV>...</DIV><DIV>&nbsp;</DIV><DIV>Call SetParent(dynTxt(dynTxt.Count - 1).hWnd, tabControl.hWnd)</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 30 May 2008 04:53:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=36008&amp;title=tabcontrol-insertitem#36008</guid>
  </item> 
  <item>
   <title><![CDATA[TabControl.InsertItem :   I like to dynamiccally fill...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=36005&amp;title=tabcontrol-insertitem#36005</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2575">Jean</a><br /><strong>Subject:</strong> 10834<br /><strong>Posted:</strong> 30 May 2008 at 3:54am<br /><br />I like to dynamiccally fill a TabControl with items and TabPages.<br>On the pages I like to load Controls.<br>I use WinApi SetParent for this.<br><br>This is the Gui of my test application:<br><img src="uploads/20080530_035609_Sample.JPG" height="242" width="544" border="0"><br><br>I can create the Items, Pages and Controls. If you switch the TabPages, everything looks fine<br>But if you click on a TextBox and then on the underlaying tabPage the TabControl is confused and doesen't show the page content proper.<br><br>Test:<br>1.) click the AddPage button twice<br>2.) select the second TabPage (new 1)<br>3.) click AddControl<br>4.) click inside the new control (the textbox)<br>5.) click below on the TabPage<br><br>I guess using SetParent causes the problem. Is there another way to create and draw the TabControl + Child-Controls dynamically?<br><br><a href="uploads/20080530_035238_Sample.zip" target="_blank">uploads/20080530_035238_Sample.zip</a><br>]]>
   </description>
   <pubDate>Fri, 30 May 2008 03:54:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10834&amp;PID=36005&amp;title=tabcontrol-insertitem#36005</guid>
  </item> 
 </channel>
</rss>