| Change Tab as container
 
 Printed From: Codejock Forums
 Category:  Codejock Products
 Forum Name:  Suite Pro
 Forum Description:  Topics Related to Codejock Suite Pro
 URL: http://forum.codejock.com/forum_posts.asp?TID=23550
 Printed Date: 31 October 2025 at 1:23am
 Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
 
 
 Topic: Change Tab as container
 Posted By: gibra
 Subject: Change Tab as container
 Date Posted: 26 January 2018 at 11:25am
 
 
        
          | I know that we can use InserItem to set the inserted tab in a new tab. 
 Instead I can't find a method to move a grid (TDBGrid) control between different existings tab.
 
 Example: I have a TabControl1 with three tabs (with no TabPage) and a grid on first tab (0).
 when I select a different tab (1 or 2) I want to move the grid on new selected tab.
 
 I tried this, but get Out of memory error:
 
 Private Sub TabControl1_BeforeItemClick(ByVal Item As XtremeSuiteControls.ITabControlItem, Cancel As Variant)
 Dim curTab As TabControlItem
 Set curTab = Item
 Set TDBGrid1.Container = curTab    '<- Error 7 - Out of memory
 End Sub
 
 How to?
 SuiteControl 15.3.1
 
 
 -------------
 gibra
 CJ SuiteControl v: 13.x to 19.x
 Windows 10 64bit
 VS2019 - VB6.0 SP6
 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
 |  
 
 Replies:
 Posted By: gibra
 Date Posted: 27 January 2018 at 11:03am
 
 
        
          | I answer myself.  
 I have discovered that also the Codejock TabControl behaves like all the other 'tabbed' controls (SSTab and TabStrip) that is:
 when you select a tab moves the controls that belong to the other tabs.
 
 In my case, I want to display the same TDBGrid control on each tabs, I simply do this:
 
 Dim m_GridLeft As Long
 
 Private Sub Form_Load()
 m_GridLeft = TDBGrid1.Left
 TabControl1.Item(0).Selected = True
 End Sub
 
 Private Sub TabControl1_SelectedChanged(ByVal Item As XtremeSuiteControls.ITabControlItem)
 TDBGrid1.Left = m_GridLeft
 TDBGrid1.Visible = True
 TDBGrid1.ZOrder
 End Sub
 
 HTH
 
  
 
 -------------
 gibra
 CJ SuiteControl v: 13.x to 19.x
 Windows 10 64bit
 VS2019 - VB6.0 SP6
 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
 |  
 
 |