Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - TabControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TabControl

 Post Reply Post Reply
Author
Message
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Topic: TabControl
    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
Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2011 at 8:27am
Create some UserControl dynamically and add it with Insertitem call.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.