Consistently Adding TabControl Pages |
Post Reply |
Author | |
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
Posted: 28 November 2011 at 10:16am |
Does anybody have a method for consistently adding tab control pages to the TabControl?
I've just spent 15 minutes trying to add a page, but it's not creating a new tab (the page just becomes part of the existing tab). When I manually bump the TabControl.ItemCount +1 then add a page to the new tab, it goes ahead and creates a new page, so I now have a blank tab in the middle. I've had trouble with this before, but usually a few tries will force the behaviour I need. Anybody know any tricks to get this working consistently? Thanks in advance. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
- Create a new form
- add a TabControl (TabControl1)
- add a TabControlPage1, set Index = 0
- into TabControlPage1(0) add a FlatEdit control, set Index=0
- add a PushButton cmdAddTab , next include the code below:
Private Sub cmdAddTab_Click()
Dim i As Long i = TabControl1.ItemCount Load TabControlPage1(i) Set TabControlPage1(i).Container = TabControl1 TabControl1.InsertItem i, "TabControlPage" & i + 1, TabControlPage1(i).hWnd, 0 ' add a FlatEdit TabControl1.SelectedItem = i ' select last add tab Load FlatEdit1(i) Set FlatEdit1(i).Container = TabControlPage1(i) FlatEdit1(i).Visible = True FlatEdit1(i).Left = 360 FlatEdit1(i).Top = 360 FlatEdit1(i).Text = "FlatEdit1(" & i & ")" End Sub |
|
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 |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
I hope this code work on SuitePro 15.1.3.
|
|
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 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Hi Gibra,
Thanks for the advice. I actually meant in design-mode (dropping a TabControlPage on a TabControl with the mouse), but I wasn't clear about that, so my apologies. In any case, perhaps it makes more sense to do it in code, if it is going to work consistently. I will give it a try. Thanks again. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Sorry, I did not realize.
However, it is simple:
- Select the TabPage from the toolbox - Click on the empty part of the TabControl (top right, to understand) and holding the left mouse button drag the mouse |
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |