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

Consistently Adding TabControl Pages

 Post Reply Post Reply
Author
Message
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 Topic: Consistently Adding TabControl Pages
    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

Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 29 November 2011 at 5:47pm
- 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
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 01 December 2011 at 1:26pm
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
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: 05 December 2011 at 8:12am
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

Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 06 December 2011 at 12:56pm
Sorry, I did not realize. Confused
 
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
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.234 seconds.