Print Page | Close Window

Consistently Adding TabControl Pages

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=19234
Printed Date: 30 November 2024 at 10:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Consistently Adding TabControl Pages
Posted By: jpbro
Subject: Consistently Adding TabControl Pages
Date 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




Replies:
Posted By: gibra
Date 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


Posted By: gibra
Date 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


Posted By: jpbro
Date 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



Posted By: gibra
Date 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



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