Print Page | Close Window

TabControl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=18458
Printed Date: 28 September 2024 at 4:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TabControl
Posted By: markmark
Subject: TabControl
Date Posted: 27 May 2011 at 6:58am
Hi
Anyone know how I add controls to the Tabcontrol via code.
I can create a new tab in code, and now I want to add some controls to that tab.
 
Many Thanks
 
Mark


-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0



Replies:
Posted By: markmark
Date Posted: 31 May 2011 at 6:26am
Anyone please!

-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0


Posted By: Oleg
Date Posted: 31 May 2011 at 8:27am
Create some UserControl dynamically and add it with Insertitem call.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date Posted: 31 May 2011 at 8:32am
Try this:


Option Explicit

Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Private Sub Form_Load()
   Load TabControlPage1(1) ' Create a new tab control page
   Me.TabControl1.InsertItem 1, "Test", Me.TabControlPage1(1).hWnd, 0   ' Add it to a new tab
   SetParent Me.Command1.hWnd, Me.TabControl1.hWnd ' First set parent to TabControl
   SetParent Me.Command1.hWnd, Me.TabControlPage1(1).hWnd   ' Then set parent to new TabControlPage
   Me.Command1.Move Me.TabControlPage1(1).Width / 2 - Me.Command1.Width / 2, Me.TabControlPage1(1).Height / 2 - Me.Command1.Height / 2 ' Move the control where you want it to be
End Sub



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: markmark
Date Posted: 31 May 2011 at 4:41pm

 That's great jpbro

Many thanks just what I needed.

I was thinking there was a add control type property that I was missing.

But that does it for me.

Thanks again

Mark



-------------
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net