├── .gitattributes ├── .gitignore ├── LICENSE.md ├── README.md ├── Test uncompiled.vbg ├── Test with ocx compiled.vbg ├── Test with ocx compiled_Readme.txt ├── control-source ├── NewTabCtl.vbp ├── bas │ ├── mCBTHook.bas │ ├── mNewTabDefaults.bas │ └── mNewTabThemes.bas ├── cls │ ├── cCommonDialog.cls │ ├── cFontEventHandler.cls │ ├── cFontEventHandlers.cls │ ├── cNewTabTheme.cls │ ├── cNewTabThemes.cls │ ├── cPropertyData.cls │ ├── cTabColors.cls │ ├── cToolTipEx.cls │ └── cUniTextBox.cls ├── cmp │ └── NewTab01.cmp ├── ctl │ ├── ctlNewTab.ctl │ └── ctlNewTab.ctx ├── frm │ ├── frmNewTabSelectControl.frm │ └── frmNewTabSelectControl.frx ├── img │ └── ToolboxBitmap.bmp ├── lib │ ├── ReadMe_VBA6_dll.txt │ └── VBA6.DLL ├── pag │ ├── pagHighlightMode.pag │ ├── pagHighlightMode.pgx │ ├── pagNewTabGeneral.pag │ ├── pagNewTabGeneral.pgx │ ├── pagNewTabHelp.pag │ ├── pagNewTabHelp.pgx │ ├── pagNewTabIcons.pag │ ├── pagNewTabIcons.pgx │ ├── pagNewTabTabs.pag │ ├── pagNewTabTabs.pgx │ └── pagNewTabThemes.pag └── subclass │ ├── cIBSSubclass.cls │ ├── cTimer.cls │ ├── mBSPropsDB.bas │ ├── mBSSubclass.bas │ └── mTimer.bas ├── docs ├── Changelog.txt ├── NewTabCtl_reference.txt ├── ReadMe.txt └── newtabctl_reference.html ├── ocx ├── NewTab01 Register (run as Admin).bat ├── NewTab01 Unregister (run as Admin).bat └── NewTab01.ocx ├── test compiled ocx ├── TDIForms test │ ├── Form1.frm │ ├── Form2.frm │ ├── Form2.frx │ ├── Form3Modal.frm │ ├── Form4.frm │ ├── Form4.frx │ ├── TDIFormsTest.vbp │ ├── frmTDIFormsTest.frm │ └── frmTDIFormsTest.frx ├── Test.vbp ├── frmAllThemes.frm ├── frmIcons.frm ├── frmMain.frm └── frmTDIControlsTest.frm └── test in source code ├── TDIForms test ├── Form1.frm ├── Form2.frm ├── Form2.frx ├── Form3Modal.frm ├── Form4.frm ├── Form4.frx ├── TDIFormsTest.vbp ├── frmTDIFormsTest.frm └── frmTDIFormsTest.frx ├── Test.vbp ├── frmIcons.frm ├── frmMain.frm └── frmTDIControlsTest.frm /.gitattributes: -------------------------------------------------------------------------------- 1 | * binary 2 | 3 | *.bas working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6 4 | *.cls working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6 5 | *.ctl working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6 6 | *.dob working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6 7 | *.dsr working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6 8 | *.frm working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6 9 | *.pag working-tree-encoding=CP1252 text eol=crlf linguist-language=vb6 10 | *.vbg working-tree-encoding=CP1252 text eol=crlf 11 | *.vbl working-tree-encoding=CP1252 text eol=crlf 12 | *.vbp working-tree-encoding=CP1252 text eol=crlf 13 | *.vbr working-tree-encoding=CP1252 text eol=crlf 14 | 15 | *.asm text 16 | *.asp text 17 | *.bat text 18 | *.c text 19 | *.cpp text 20 | *.dsp text 21 | *.dsw text 22 | *.h text 23 | *.idl text 24 | *.java text 25 | *.js text 26 | *.manifest text 27 | *.odl text 28 | *.php text 29 | *.php3 text 30 | *.rc text 31 | *.sln text 32 | *.sql text 33 | *.vb text 34 | *.vbs text 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.oca 2 | *.lib 3 | *.exp 4 | *.log 5 | *.vbw 6 | *.lnk 7 | *.tmp 8 | /docs/Documenter 9 | ToDo.txt 10 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 EduardoVB 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NewTab 2 | Tab control for VB6. 3 | 4 | [For more information please go to the vbForums thread](https://www.vbforums.com/showthread.php?898291-NewTab-tab-control-for-VB6&p=5585735#post5585735) 5 | 6 | ![imagen](https://user-images.githubusercontent.com/42319299/201179828-9b70c692-bacf-4705-8925-37587ea5fe93.png) 7 | 8 | ![imagen](https://user-images.githubusercontent.com/42319299/201179867-2bc20ee2-b9a9-4424-b3fd-05a74170bd32.png) 9 | 10 | [Download the OCX file.](https://github.com/EduardoVB/NewTab/raw/main/ocx/NewTab01.ocx) 11 | 12 | [Open the help documentation online.](https://htmlpreview.github.io/?https://github.com/EduardoVB/NewTab/blob/main/docs/newtabctl_reference.html) 13 | -------------------------------------------------------------------------------- /Test uncompiled.vbg: -------------------------------------------------------------------------------- 1 | VBGROUP 5.0 2 | Project=control-source\NewTabCtl.vbp 3 | StartupProject=test in source code\Test.vbp 4 | Project=test in source code\TDIForms test\TDIFormsTest.vbp 5 | -------------------------------------------------------------------------------- /Test with ocx compiled.vbg: -------------------------------------------------------------------------------- 1 | VBGROUP 5.0 2 | StartupProject=test compiled ocx\Test.vbp 3 | Project=test compiled ocx\TDIForms test\TDIFormsTest.vbp 4 | -------------------------------------------------------------------------------- /Test with ocx compiled_Readme.txt: -------------------------------------------------------------------------------- 1 | Run the file: 2 | 3 | NewTab01 Register (run as Admin).bat 4 | 5 | that is in the 'ocx' folder, to be able to use the OCX 6 | 7 | And run the IDE as admin too, at least the first time. -------------------------------------------------------------------------------- /control-source/NewTabCtl.vbp: -------------------------------------------------------------------------------- 1 | Type=Control 2 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\SysWow64\stdole2.tlb#OLE Automation 3 | UserControl=ctl\ctlNewTab.ctl 4 | PropertyPage=pag\pagNewTabGeneral.pag 5 | PropertyPage=pag\pagNewTabTabs.pag 6 | PropertyPage=pag\pagNewTabIcons.pag 7 | Class=cCommonDialog; cls\cCommonDialog.cls 8 | PropertyPage=pag\pagNewTabHelp.pag 9 | Module=mBSPropsDB; subclass\mBSPropsDB.bas 10 | Module=mBSSubclass; subclass\mBSSubclass.bas 11 | Class=IBSSubclass; subclass\cIBSSubclass.cls 12 | Form=frm\frmNewTabSelectControl.frm 13 | PropertyPage=pag\pagNewTabThemes.pag 14 | Module=mNewTabDefaults; bas\mNewTabDefaults.bas 15 | Module=mNewTabThemes; bas\mNewTabThemes.bas 16 | Class=cPropertyData; cls\cPropertyData.cls 17 | Class=NewTabTheme; cls\cNewTabTheme.cls 18 | Class=cFontEventHandler; cls\cFontEventHandler.cls 19 | Class=cFontEventHandlers; cls\cFontEventHandlers.cls 20 | Class=NewTabThemes; cls\cNewTabThemes.cls 21 | PropertyPage=pag\pagHighlightMode.pag 22 | Class=cToolTipEx; cls\cToolTipEx.cls 23 | Module=mTimer; subclass\mTimer.bas 24 | Class=cTimer; subclass\cTimer.cls 25 | Class=cUniTextBox; cls\cUniTextBox.cls 26 | Module=mCBTHook; bas\mCBTHook.bas 27 | Class=cTabColors; cls\cTabColors.cls 28 | Startup="(None)" 29 | HelpFile="" 30 | Title="NewTab: tabbed control" 31 | ExeName32="NewTab01.ocx" 32 | Path32="..\ocx" 33 | Command32="" 34 | Name="NewTabCtl" 35 | HelpContextID="0" 36 | Description="NewTab: tabbed control" 37 | CompatibleMode="0" 38 | CompatibleEXE32="cmp\NewTab01.cmp" 39 | MajorVer=13 40 | MinorVer=0 41 | RevisionVer=273 42 | AutoIncrementVer=1 43 | ServerSupportFiles=0 44 | VersionCompanyName="Empresa" 45 | CompilationType=0 46 | OptimizationType=0 47 | FavorPentiumPro(tm)=0 48 | CodeViewDebugInfo=0 49 | NoAliasing=0 50 | BoundsCheck=0 51 | OverflowCheck=0 52 | FlPointCheck=0 53 | FDIVCheck=0 54 | UnroundedFP=0 55 | StartMode=1 56 | Unattended=0 57 | Retained=0 58 | ThreadPerObject=0 59 | MaxNumberOfThreads=1 60 | ThreadingModel=1 61 | 62 | [MS Transaction Server] 63 | AutoRefresh=1 64 | -------------------------------------------------------------------------------- /control-source/bas/mCBTHook.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "mCBTHook" 2 | Option Explicit 3 | 4 | Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long 5 | Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long 6 | Private Declare Function SetWindowSubclass Lib "comctl32" (ByVal hWnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long, ByVal dwRefData As Long) As Long 7 | Private Declare Function DefSubclassProc Lib "comctl32" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long 8 | Private Declare Function RemoveWindowSubclass Lib "comctl32" (ByVal hWnd As Long, ByVal pfnSubclass As Long, ByVal uIdSubclass As Long) As Long 9 | Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long 10 | Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongW" (ByVal hWnd As Long, ByVal nIndex As Long) As Long 11 | 12 | Private mCBTHook As Long 13 | Private mAddressOfWindowProc As Long 14 | Private mHwndSubclassed As Long 15 | Private mNewTabControl As NewTab 16 | 17 | Public Sub InstallCBTHook(nNewTabControl As NewTab) 18 | Const WH_CBT = 5 19 | 20 | If mCBTHook = 0 Then 21 | Set mNewTabControl = nNewTabControl 22 | mCBTHook = SetWindowsHookEx(WH_CBT, AddressOf FormCreationHookProc, App.hInstance, App.ThreadID) 23 | End If 24 | End Sub 25 | 26 | Public Sub UninstallCBTHook() 27 | If mCBTHook <> 0 Then 28 | UnhookWindowsHookEx mCBTHook 29 | mCBTHook = 0 30 | Set mNewTabControl = Nothing 31 | End If 32 | End Sub 33 | 34 | Private Function FormCreationHookProc(ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long 35 | Const HCBT_CREATEWND = 3 36 | Const HCBT_DESTROYWND = 4 37 | Const HCBT_ACTIVATE = 5 38 | Const HCBT_SETFOCUS = 9 39 | 40 | If uMsg = HCBT_CREATEWND Then 41 | Dim iStr As String 42 | 43 | If mAddressOfWindowProc = 0 Then 44 | mAddressOfWindowProc = GetAddresOfProc(AddressOf WindowProc) 45 | End If 46 | If mHwndSubclassed = 0 Then 47 | iStr = GetWindowClassName(wParam) 48 | If (iStr = "ThunderFormDC") Or (iStr = "ThunderRT6FormDC") Then 49 | mHwndSubclassed = wParam 50 | SetWindowSubclass mHwndSubclassed, mAddressOfWindowProc, 1&, 0& 51 | End If 52 | End If 53 | ElseIf uMsg = HCBT_DESTROYWND Then 54 | iStr = GetWindowClassName(wParam) 55 | If (iStr = "ThunderFormDC") Or (iStr = "ThunderRT6FormDC") Then 56 | If Not mNewTabControl Is Nothing Then mNewTabControl.TDIFormClosing wParam 57 | End If 58 | ElseIf (uMsg = HCBT_ACTIVATE) Or (uMsg = HCBT_SETFOCUS) Then 59 | iStr = GetWindowClassName(wParam) 60 | If (iStr = "ThunderFormDC") Or (iStr = "ThunderRT6FormDC") Then 61 | mNewTabControl.TDIFocusForm wParam 62 | End If 63 | End If 64 | End Function 65 | 66 | Private Function WindowProc(ByVal hWnd As Long, ByVal iMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal uIdSubclass As Long, ByVal dwRefData As Long) As Long 67 | Const WM_DESTROY As Long = &H2 68 | Const WM_NCDESTROY As Long = &H82& 69 | Const WM_SHOWWINDOW As Long = &H18& 70 | Const GWL_EXSTYLE As Long = (-20) 71 | Const WS_EX_TOOLWINDOW As Long = &H80& 72 | 73 | If (iMsg = WM_SHOWWINDOW) Or (iMsg = WM_DESTROY) Or (iMsg = WM_NCDESTROY) Then 74 | RemoveWindowSubclass hWnd, mAddressOfWindowProc, 1& 75 | If iMsg = WM_SHOWWINDOW Then 76 | If Not mNewTabControl Is Nothing Then 77 | If mNewTabControl.IsParentEnabled Then 78 | If WindowHasCaption(mHwndSubclassed) Then 79 | If (GetWindowLong(mHwndSubclassed, GWL_EXSTYLE) And WS_EX_TOOLWINDOW) = 0 Then 80 | mNewTabControl.TDIPutFormIntoTab mHwndSubclassed 81 | End If 82 | End If 83 | Else 84 | mNewTabControl.ShowsModalForm 85 | End If 86 | End If 87 | End If 88 | mHwndSubclassed = 0 89 | End If 90 | WindowProc = DefSubclassProc(hWnd, iMsg, wParam, ByVal lParam) 91 | End Function 92 | 93 | Private Function GetAddresOfProc(nProcAddress As Long) As Long 94 | GetAddresOfProc = nProcAddress 95 | End Function 96 | 97 | Private Function GetWindowClassName(nHwnd As Long) As String 98 | Dim iClassName As String 99 | Dim iSize As Long 100 | 101 | If nHwnd = 0 Then Exit Function 102 | 103 | iClassName = Space$(64) 104 | iSize = GetClassName(nHwnd, iClassName, Len(iClassName)) 105 | GetWindowClassName = Left$(iClassName, iSize) 106 | End Function 107 | 108 | Private Function WindowHasCaption(nHwnd As Long) As Boolean 109 | Const WS_CAPTION = &HC00000 110 | Const GWL_STYLE = (-16) 111 | 112 | WindowHasCaption = (GetWindowLong(nHwnd, GWL_STYLE) And WS_CAPTION) <> 0 113 | End Function 114 | 115 | -------------------------------------------------------------------------------- /control-source/bas/mNewTabDefaults.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "mNewTabDefaults" 2 | Option Explicit 3 | 4 | Public Const cPropDef_Style As Long = ntStyleWindows ' ssStyleTabbedDialog 5 | Public Const cPropDef_TabHeight As Long = 238 ' in twips 6 | Public Const cPropDef_WordWrap As Boolean = True 7 | Public Const cPropDef_MaskColor As Long = &HFF00FF 8 | Public Const cPropDef_UseMaskColor As Boolean = True 9 | Public Const cPropDef_ShowFocusRect As Boolean = False 10 | Public Const cPropDef_TabsPerRow As Long = 3 11 | Public Const cPropDef_ShowDisabledState As Boolean = False 12 | Public Const cPropDef_ChangeControlsBackColor As Boolean = True 13 | Public Const cPropDef_ChangeControlsForeColor As Boolean = True 14 | Public Const cPropDef_HighlightEffect As Boolean = True 15 | Public Const cPropDef_TabWidthStyle As Long = ntTWAuto 16 | Public Const cPropDef_ShowRowsInPerspective As Long = ntYNAuto 17 | Public Const cPropDef_TabSeparation As Integer = 0 18 | Public Const cPropDef_TabAppearance As Long = ntTAAuto 19 | Public Const cPropDef_IconAlignment As Long = ntIconAlignCenteredBeforeCaption ' ntIconAlignBeforeCaption 20 | Public Const cPropDef_AutoRelocateControls As Long = ntRelocateAlways 21 | Public Const cPropDef_SoftEdges As Boolean = True 22 | Public Const cPropDef_HandleHighContrastThem As Boolean = True 23 | Public Const cPropDef_BackStyle As Long = ntOpaque 24 | Public Const cPropDef_AutoTabHeight As Boolean = True 25 | Public Const cPropDef_OLEDropOnOtherTabs As Boolean = True 26 | Public Const cPropDef_TabTransition As Long = ntTransitionImmediate ' ntTransitionFaster 27 | Public Const cPropDef_FlatBarColorSelectedTab As Long = &HFC7A43 ' &HF1956D 28 | Public Const cPropDef_FlatRoundnessTop As Long = 8 29 | Public Const cPropDef_FlatRoundnessBottom As Long = 8 30 | Public Const cPropDef_FlatRoundnessTabs As Long = 0 31 | Public Const cPropDef_TabMousePointerHand As Boolean = False 32 | Public Const cPropDef_IconFontName As String = "Segoe MDL2 Assets" ' "Wingdings" 33 | Public Const cPropDef_IconFontSize As Single = 11 34 | Public Const cPropDef_HighlightMode As Long = ntHLAuto 35 | Public Const cPropDef_HighlightModeSelectedTab As Long = ntHLAuto 36 | Public Const cPropDef_FlatBorderMode As Long = ntBorderTabs 37 | Public Const cPropDef_FlatBarHeight As Long = 3 38 | Public Const cPropDef_FlatBarGripHeight As Long = -5 39 | Public Const cPropDef_FlatBarPosition As Long = ntBarPositionTop 40 | Public Const cPropDef_CanReorderTabs As Boolean = False 41 | Public Const cPropDef_TDIMode As Long = ntTDIModeNone 42 | Public Const cPropDef_HighlightTabExtraHeight As Long = 40 'twips 43 | Public Const cPropDef_FlatBodySeparationLineHeight As Long = 1 44 | Public Const cPropDef_TabMaxWidth As Long = 0 45 | Public Const cPropDef_TabMinWidth As Long = 0 46 | Public Const cPropDef_SubclassingMethod As Long = ntSMSetWindowSubclass 47 | Public Const cPropDef_TabsEndFreeSpace As Long = 0 48 | Public Const cPropDef_CaptionAlignment As Long = ntAlignmentCenter 49 | 50 | -------------------------------------------------------------------------------- /control-source/cls/cFontEventHandler.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "cFontEventHandler" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = False 14 | Option Explicit 15 | 16 | Private WithEvents mFont As StdFont 17 | Attribute mFont.VB_VarHelpID = -1 18 | Private mParent As cFontEventHandlers 19 | 20 | Public Sub SetFont(ByRef nFont As StdFont, ByRef nParent As cFontEventHandlers) 21 | Set mFont = nFont 22 | Set mParent = nParent 23 | End Sub 24 | 25 | Public Sub Release() 26 | Set mParent = Nothing 27 | End Sub 28 | 29 | Private Sub mFont_FontChanged(ByVal PropertyName As String) 30 | mParent.RaiseFontEvent PropertyName 31 | End Sub 32 | -------------------------------------------------------------------------------- /control-source/cls/cFontEventHandlers.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "cFontEventHandlers" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = False 14 | Option Explicit 15 | 16 | Event FontChanged(ByVal PropertyName As String) 17 | 18 | Private mFontsEventHandlers As Collection 19 | 20 | Public Sub RaiseFontEvent(ByRef PropertyName As String) 21 | RaiseEvent FontChanged(PropertyName) 22 | End Sub 23 | 24 | Private Sub Class_Initialize() 25 | Set mFontsEventHandlers = New Collection 26 | End Sub 27 | 28 | Private Sub Class_Terminate() 29 | Set mFontsEventHandlers = Nothing 30 | End Sub 31 | 32 | Public Sub AddFont(nFont As StdFont, nTabIndex As Long) 33 | Dim iFeh As cFontEventHandler 34 | 35 | Set iFeh = New cFontEventHandler 36 | iFeh.SetFont nFont, Me 37 | mFontsEventHandlers.Add iFeh, CStr(ObjPtr(nFont)) & "_" & CStr(nTabIndex) 38 | End Sub 39 | 40 | Public Sub RemoveFont(nFont As StdFont, nTabIndex As Long) 41 | Dim iFeh As cFontEventHandler 42 | Dim iKey As String 43 | 44 | iKey = CStr(ObjPtr(nFont)) & "_" & CStr(nTabIndex) 45 | Set iFeh = mFontsEventHandlers(iKey) 46 | iFeh.Release 47 | mFontsEventHandlers.Remove iKey 48 | End Sub 49 | 50 | Public Sub Release() 51 | Dim iFeh As cFontEventHandler 52 | 53 | For Each iFeh In mFontsEventHandlers 54 | iFeh.Release 55 | Next 56 | Set mFontsEventHandlers = New Collection 57 | End Sub 58 | -------------------------------------------------------------------------------- /control-source/cls/cNewTabTheme.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "NewTabTheme" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = True 14 | Attribute VB_Description = """Themes"" are a set of property settings stored together." 15 | Option Explicit 16 | 17 | Private Declare Function HashData Lib "shlwapi" (ByVal pbData As Long, ByVal cbData As Long, ByRef pbHash As Any, ByVal cbHash As Long) As Long 18 | 19 | Private mName As String 20 | Private mHash As String 21 | Private mData As Collection 22 | Private mCustom As Boolean 23 | Private mTag As String 24 | Private mThemeString As String 25 | 26 | Friend Property Get ThemeString() As String 27 | If mThemeString = "" Then 28 | MakeThemeString 29 | End If 30 | ThemeString = mThemeString 31 | End Property 32 | 33 | Private Sub MakeThemeString() 34 | Dim iProp As cPropertyData 35 | Dim c As Long 36 | 37 | For c = 1 To mData.Count 38 | Set iProp = mData(c) 39 | mThemeString = mThemeString & IIf(mThemeString = "", "", "|") & iProp.Name & "=" & Trim$(CStr(iProp.Value)) 40 | Next 41 | mHash = GetThemeStringHash(mThemeString) 42 | End Sub 43 | 44 | Friend Property Let ThemeString(nThemeString As String) 45 | Dim s3() As String 46 | Dim s4() As String 47 | Dim c3 As Long 48 | Dim iProp As cPropertyData 49 | 50 | Set mData = New Collection 51 | mThemeString = "" 52 | mHash = "" 53 | s3 = Split(nThemeString, "|") ' tuples of property name and property value 54 | For c3 = 0 To UBound(s3) 55 | s4 = Split(s3(c3), "=") ' property name = property value 56 | If UBound(s4) = 1 Then 57 | Set iProp = New cPropertyData 58 | iProp.Name = s4(0) 59 | If IsNumeric(s4(1)) Then 60 | iProp.Value = Val(s4(1)) 61 | If iProp.Value = Int(iProp.Value) Then 62 | iProp.Value = CLng(iProp.Value) 63 | End If 64 | Else 65 | iProp.Value = s4(1) 66 | End If 67 | mData.Add iProp, iProp.Name 68 | End If 69 | Next 70 | End Property 71 | 72 | Friend Property Get Data() As Collection 73 | Set Data = mData 74 | End Property 75 | 76 | Friend Property Get Hash() As String 77 | If mHash = "" Then 78 | MakeThemeString 79 | End If 80 | Hash = mHash 81 | End Property 82 | 83 | Private Function GetThemeStringHash(nThemeString As String) As String 84 | GetThemeStringHash = SimpleHash(nThemeString) 85 | End Function 86 | 87 | Private Function SimpleHash(ByVal nData As Variant, Optional nNumberOfHashCharacters_MustBeEvenAndLessThan512 As Long = 16) As String 88 | Dim iHashBytes() As Byte 89 | Dim c As Long 90 | Dim n As Long 91 | Dim iStr As String 92 | Dim iVarType As Long 93 | Dim iDataBytes() As Byte 94 | 95 | 'If nNumberOfHashCharacters_MustBeEvenAndLessThan512 Mod 2 <> 0 Then Err.Raise 1142, App.Title & ".SimpleHash", "nNumberOfHashCharacters_MustBeEvenAndLessThan512 must be even." 96 | 'If nNumberOfHashCharacters_MustBeEvenAndLessThan512 < 2 Then Err.Raise 1142, App.Title & ".SimpleHash", "nNumberOfHashCharacters_MustBeEvenAndLessThan512 must 2 or more." 97 | 'If nNumberOfHashCharacters_MustBeEvenAndLessThan512 > 512 Then Err.Raise 1142, App.Title & ".SimpleHash", "nNumberOfHashCharacters_MustBeEvenAndLessThan512 must 512 or less." 98 | 99 | n = (nNumberOfHashCharacters_MustBeEvenAndLessThan512 / 2) 100 | ReDim iHashBytes(n - 1) 101 | iVarType = VarType(nData) 102 | If iVarType = vbString Then 103 | iStr = nData 104 | HashData StrPtr(iStr), 2 * Len(iStr), iHashBytes(0), n 105 | Else 106 | If iVarType <> vbArray + vbByte Then 107 | Err.Raise 2345, , "Invalid data type" 108 | Exit Function 109 | Else 110 | iDataBytes = nData 111 | HashData VarPtr(iDataBytes(0)), UBound(iDataBytes) + 1, iHashBytes(0), n 112 | End If 113 | End If 114 | For c = 0 To UBound(iHashBytes) 115 | iStr = Hex$(iHashBytes(c)) 116 | If Len(iStr) = 1 Then 117 | iStr = "0" & iStr 118 | End If 119 | SimpleHash = SimpleHash & iStr 120 | Next c 121 | End Function 122 | 123 | Friend Function Serialize() As Byte() 124 | Dim iPb As PropertyBag 125 | Dim iProp As cPropertyData 126 | Dim c As Long 127 | 128 | Set iPb = New PropertyBag 129 | iPb.WriteProperty "Name", Name 130 | iPb.WriteProperty "Custom", Custom, False 131 | iPb.WriteProperty "Hash", Hash 132 | iPb.WriteProperty "PropertyCount", mData.Count 133 | For c = 1 To mData.Count 134 | Set iProp = mData(c) 135 | iPb.WriteProperty "PN" & c, iProp.Name 136 | iPb.WriteProperty "PV" & c, iProp.Value 137 | Next 138 | Serialize = iPb.Contents 139 | End Function 140 | 141 | Friend Sub Deserialize(nBytes() As Byte) 142 | Dim iPb As PropertyBag 143 | Dim iProp As cPropertyData 144 | Dim c As Long 145 | Dim iPropertyCount As Long 146 | 147 | Set mData = New Collection 148 | mThemeString = "" 149 | Set iPb = New PropertyBag 150 | iPb.Contents = nBytes 151 | Name = iPb.ReadProperty("Name", "") 152 | Custom = iPb.ReadProperty("Custom", False) 153 | mHash = iPb.ReadProperty("Hash", "") 154 | iPropertyCount = iPb.ReadProperty("PropertyCount", 0) 155 | For c = 1 To iPropertyCount 156 | Set iProp = New cPropertyData 157 | iProp.Name = iPb.ReadProperty("PN" & c, "") 158 | iProp.Value = iPb.ReadProperty("PV" & c, Empty) 159 | If Not IsEmpty(iProp.Value) Then 160 | mData.Add iProp, iProp.Name 161 | End If 162 | Next 163 | End Sub 164 | 165 | Friend Function Clone() As NewTabTheme 166 | Set Clone = New NewTabTheme 167 | Clone.SetData mThemeString, mHash, mData 168 | Clone.Name = Me.Name 169 | Clone.Custom = Me.Custom 170 | End Function 171 | 172 | Friend Sub SetData(ByRef nThemeString As String, ByRef nHash As String, ByRef nData As Collection) 173 | Dim iProp As cPropertyData 174 | Dim iPropNew As cPropertyData 175 | 176 | mThemeString = nThemeString 177 | mHash = nHash 178 | Set mData = New Collection 179 | For Each iProp In nData 180 | Set iPropNew = New cPropertyData 181 | iPropNew.Name = iProp.Name 182 | iPropNew.Value = iProp.Value 183 | mData.Add iPropNew, iPropNew.Name 184 | Next 185 | End Sub 186 | 187 | 188 | Public Property Get Name() As String 189 | Attribute Name.VB_Description = "Returns the name of the theme." 190 | Attribute Name.VB_MemberFlags = "200" 191 | Name = mName 192 | End Property 193 | 194 | Friend Property Let Name(ByVal nName As String) 195 | mName = Trim$(nName) 196 | End Property 197 | 198 | 199 | Public Property Get Custom() As Boolean 200 | Attribute Custom.VB_Description = "Returns whether this theme is custom or built-in by default." 201 | Custom = mCustom 202 | End Property 203 | 204 | Friend Property Let Custom(nValue As Boolean) 205 | mCustom = nValue 206 | End Property 207 | 208 | 209 | Friend Property Get Tag() As String 210 | Tag = mTag 211 | End Property 212 | 213 | Friend Property Let Tag(nTag As String) 214 | mTag = nTag 215 | End Property 216 | 217 | Private Sub Class_Initialize() 218 | mCustom = True 219 | End Sub 220 | -------------------------------------------------------------------------------- /control-source/cls/cNewTabThemes.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "NewTabThemes" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = True 14 | Attribute VB_Description = "Returns the colection of ""Themes""." 15 | Option Explicit 16 | 17 | Event ThemeRenamed() 18 | Attribute ThemeRenamed.VB_Description = "Occurs after a theme has ben renamed." 19 | Event ThemeRemoved() 20 | Attribute ThemeRemoved.VB_Description = "Occurs after a theme has been removed." 21 | 22 | Private mThemes As Collection 23 | Private mDefaultThemesCopied As Boolean 24 | 25 | Public Property Get Count() As Long 26 | Attribute Count.VB_Description = "Returns the number of themes in the collection." 27 | Attribute Count.VB_UserMemId = -531 28 | EnsureDefaultThemesCopied 29 | Count = mThemes.Count 30 | End Property 31 | 32 | Private Sub Class_Initialize() 33 | Set mThemes = New Collection 34 | mDefaultThemesCopied = False 35 | End Sub 36 | 37 | Private Sub Class_Terminate() 38 | Set mThemes = Nothing 39 | End Sub 40 | 41 | Public Property Get Item(ByVal IndexOrKey As Variant) As NewTabTheme 42 | Attribute Item.VB_Description = "Returns a NewTabTheme object." 43 | Attribute Item.VB_UserMemId = 0 44 | EnsureDefaultThemesCopied 45 | If VarType(IndexOrKey) = vbString Then 46 | IndexOrKey = Trim$(IndexOrKey) 47 | End If 48 | On Error Resume Next 49 | Set Item = mThemes(IndexOrKey) 50 | If Err.Number Then 51 | Err.Clear 52 | Err.Raise 5 ' Invalid procedure call or argument 53 | Dim iStr As String 54 | iStr = Err.Description 55 | On Error GoTo 0 56 | Err.Raise 5, App.Title & ", " & TypeName(Me), iStr & ". Theme doesn't exist." 57 | End If 58 | End Property 59 | 60 | Public Function NewEnum() As IUnknown 61 | Attribute NewEnum.VB_UserMemId = -4 62 | Attribute NewEnum.VB_MemberFlags = "40" 63 | EnsureDefaultThemesCopied 64 | Set NewEnum = mThemes.[_NewEnum] 65 | End Function 66 | 67 | Friend Sub Add(ByVal nTheme As NewTabTheme) 68 | EnsureDefaultThemesCopied 69 | mThemes.Add nTheme, nTheme.Name 70 | End Sub 71 | 72 | Public Function Exists(ByVal nThemeName As String) As Boolean 73 | Attribute Exists.VB_Description = "Returns True if the theme exists in the collection." 74 | Dim iTheme As NewTabTheme 75 | 76 | nThemeName = Trim$(nThemeName) 77 | EnsureDefaultThemesCopied 78 | On Error Resume Next 79 | Set iTheme = mThemes(nThemeName) 80 | Exists = Not iTheme Is Nothing 81 | End Function 82 | 83 | Public Sub Remove(ByVal nThemeName As String) 84 | Attribute Remove.VB_Description = "Removes a theme from the collection." 85 | EnsureDefaultThemesCopied 86 | 87 | nThemeName = Trim$(nThemeName) 88 | If Not Exists(nThemeName) Then 89 | Err.Clear 90 | Err.Raise 5 ' Invalid procedure call or argument 91 | Dim iStr As String 92 | iStr = Err.Description 93 | On Error GoTo 0 94 | Err.Raise 5, App.Title & ", " & TypeName(Me), iStr & ". Theme doesn't exist." 95 | Exit Sub 96 | End If 97 | mThemes.Remove nThemeName 98 | RaiseEvent ThemeRemoved 99 | End Sub 100 | 101 | Public Sub Rename(ByVal nOldThemeName As String, ByVal nNewThemeName As String) 102 | Attribute Rename.VB_Description = "Renames a theme." 103 | Dim iTheme As NewTabTheme 104 | Dim iStr As String 105 | 106 | nOldThemeName = Trim$(nOldThemeName) 107 | nNewThemeName = Trim$(nNewThemeName) 108 | EnsureDefaultThemesCopied 109 | If nOldThemeName = nNewThemeName Then Exit Sub 110 | If Not Exists(nOldThemeName) Then 111 | Err.Clear 112 | Err.Raise 5 ' Invalid procedure call or argument 113 | iStr = Err.Description 114 | On Error GoTo 0 115 | Err.Raise 5, App.Title & ", " & TypeName(Me), iStr & ". Theme doesn't exist." 116 | Exit Sub 117 | End If 118 | If LCase$(nOldThemeName) <> LCase$(nNewThemeName) Then 119 | If Exists(nNewThemeName) Then 120 | Err.Clear 121 | Err.Raise 5 ' Invalid procedure call or argument 122 | iStr = Err.Description 123 | On Error GoTo 0 124 | Err.Raise 5, App.Title & ", " & TypeName(Me), iStr & ". New name already exist." 125 | Exit Sub 126 | End If 127 | End If 128 | 129 | Set iTheme = mThemes(nOldThemeName) 130 | Remove nOldThemeName 131 | iTheme.Name = nNewThemeName 132 | Add iTheme 133 | RaiseEvent ThemeRenamed 134 | End Sub 135 | 136 | Private Sub EnsureDefaultThemesCopied() 137 | Dim iDefThemes As NewTabThemes 138 | Dim iTheme As NewTabTheme 139 | Dim iTheme2 As NewTabTheme 140 | 141 | If Not mDefaultThemesCopied Then 142 | Set iDefThemes = GetDefaultThemes 143 | mDefaultThemesCopied = True 144 | For Each iTheme In iDefThemes 145 | Set iTheme2 = iTheme.Clone 146 | Add iTheme2 147 | Next 148 | End If 149 | End Sub 150 | 151 | Friend Function Clone() As NewTabThemes 152 | Dim iTheme As NewTabTheme 153 | 154 | Set Clone = New NewTabThemes 155 | For Each iTheme In mThemes 156 | If iTheme.Custom Then 157 | Clone.Add iTheme.Clone 158 | End If 159 | Next 160 | End Function 161 | 162 | Friend Function ThereAreCustomThemes() As Boolean 163 | If mThemes.Count > 0 Then 164 | ThereAreCustomThemes = mThemes(mThemes.Count).Custom 165 | End If 166 | End Function 167 | 168 | Friend Property Let DoNotCopyDefaultThemes(nValue As Boolean) 169 | mDefaultThemesCopied = nValue 170 | End Property 171 | -------------------------------------------------------------------------------- /control-source/cls/cPropertyData.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "cPropertyData" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = False 14 | Option Explicit 15 | 16 | Public Name As String 17 | Public Value As Variant 18 | 19 | -------------------------------------------------------------------------------- /control-source/cls/cTabColors.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "cTabColors" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = False 14 | Option Explicit 15 | 16 | Private mFlatBarHighlightEffectColors(10) As Long 17 | Private mHighlightEffectColors_Strong(10) As Long 18 | Private mHighlightEffectColors_Light(10) As Long 19 | 20 | Public BackColorTab As Variant 21 | Public BackColorSelectedTab As Variant 22 | Public HighlightColor As Variant 23 | Public HighlightColorSelectedTab As Variant 24 | 25 | Public FlatBarColorInactive As Variant 26 | Public FlatBarColorHighlight As Variant 27 | Public FlatBarColorSelectedTab As Variant 28 | 29 | Public FlatTabBorderColorHighlight As Variant 30 | Public FlatTabBorderColorSelectedTab As Variant 31 | 32 | Public ForeColor As Variant 33 | Public ForeColorHighlighted As Variant 34 | Public ForeColorSelectedTab As Variant 35 | 36 | Public IconColor As Variant 37 | Public IconColorSelectedTab As Variant 38 | Public IconColorMouseHover As Variant 39 | Public IconColorMouseHoverSelectedTab As Variant 40 | Public IconColorTabHighlighted As Variant 41 | 42 | 43 | Public GlowColor As Long 44 | Public FlatBarGlowColor As Long 45 | 46 | Public Property Get FlatBarHighlightEffectColors(ByVal nStep As Long) As Long 47 | FlatBarHighlightEffectColors = mFlatBarHighlightEffectColors(nStep) 48 | End Property 49 | 50 | Public Property Let FlatBarHighlightEffectColors(ByVal nStep As Long, ByVal nColor As Long) 51 | mFlatBarHighlightEffectColors(nStep) = nColor 52 | End Property 53 | 54 | 55 | Public Property Get HighlightEffectColors_Light(ByVal nStep As Long) As Long 56 | HighlightEffectColors_Light = mHighlightEffectColors_Light(nStep) 57 | End Property 58 | 59 | Public Property Let HighlightEffectColors_Light(ByVal nStep As Long, ByVal nColor As Long) 60 | mHighlightEffectColors_Light(nStep) = nColor 61 | End Property 62 | 63 | 64 | Public Property Get HighlightEffectColors_Strong(ByVal nStep As Long) As Long 65 | HighlightEffectColors_Strong = mHighlightEffectColors_Strong(nStep) 66 | End Property 67 | 68 | Public Property Let HighlightEffectColors_Strong(ByVal nStep As Long, ByVal nColor As Long) 69 | mHighlightEffectColors_Strong(nStep) = nColor 70 | End Property 71 | 72 | Friend Function Serialize() As Byte() 73 | Dim iPb As PropertyBag 74 | 75 | Set iPb = New PropertyBag 76 | 77 | iPb.WriteProperty "BackColorTab", BackColorTab, Empty 78 | iPb.WriteProperty "BackColorSelectedTab", BackColorSelectedTab, Empty 79 | iPb.WriteProperty "HighlightColor", HighlightColor, Empty 80 | iPb.WriteProperty "HighlightColorSelectedTab", HighlightColorSelectedTab, Empty 81 | iPb.WriteProperty "FlatBarColorInactive", FlatBarColorInactive, Empty 82 | iPb.WriteProperty "FlatBarColorHighlight", FlatBarColorHighlight, Empty 83 | iPb.WriteProperty "FlatBarColorSelectedTab", FlatBarColorSelectedTab, Empty 84 | iPb.WriteProperty "FlatTabBorderColorHighlight", FlatTabBorderColorHighlight, Empty 85 | iPb.WriteProperty "FlatTabBorderColorSelectedTab", FlatTabBorderColorSelectedTab, Empty 86 | iPb.WriteProperty "ForeColor", ForeColor, Empty 87 | iPb.WriteProperty "ForeColorHighlighted", ForeColorHighlighted, Empty 88 | iPb.WriteProperty "ForeColorSelectedTab", ForeColorSelectedTab, Empty 89 | iPb.WriteProperty "IconColor", IconColor, Empty 90 | iPb.WriteProperty "IconColorSelectedTab", IconColorSelectedTab, Empty 91 | iPb.WriteProperty "IconColorMouseHover", IconColorMouseHover, Empty 92 | iPb.WriteProperty "IconColorMouseHoverSelectedTab", IconColorMouseHoverSelectedTab, Empty 93 | iPb.WriteProperty "IconColorTabHighlighted", IconColorTabHighlighted, Empty 94 | 95 | Serialize = iPb.Contents 96 | End Function 97 | 98 | Friend Sub Deserialize(nBytes() As Byte) 99 | Dim iPb As PropertyBag 100 | 101 | Set iPb = New PropertyBag 102 | iPb.Contents = nBytes 103 | 104 | BackColorTab = iPb.ReadProperty("BackColorTab", Empty) 105 | BackColorSelectedTab = iPb.ReadProperty("BackColorSelectedTab", Empty) 106 | HighlightColor = iPb.ReadProperty("HighlightColor", Empty) 107 | HighlightColorSelectedTab = iPb.ReadProperty("HighlightColorSelectedTab", Empty) 108 | FlatBarColorInactive = iPb.ReadProperty("FlatBarColorInactive", Empty) 109 | FlatBarColorHighlight = iPb.ReadProperty("FlatBarColorHighlight", Empty) 110 | FlatBarColorSelectedTab = iPb.ReadProperty("FlatBarColorSelectedTab", Empty) 111 | FlatTabBorderColorHighlight = iPb.ReadProperty("FlatTabBorderColorHighlight", Empty) 112 | FlatTabBorderColorSelectedTab = iPb.ReadProperty("FlatTabBorderColorSelectedTab", Empty) 113 | ForeColor = iPb.ReadProperty("ForeColor", Empty) 114 | ForeColorHighlighted = iPb.ReadProperty("ForeColorHighlighted", Empty) 115 | ForeColorSelectedTab = iPb.ReadProperty("ForeColorSelectedTab", Empty) 116 | IconColor = iPb.ReadProperty("IconColor", Empty) 117 | IconColorSelectedTab = iPb.ReadProperty("IconColorSelectedTab", Empty) 118 | IconColorMouseHover = iPb.ReadProperty("IconColorMouseHover", Empty) 119 | IconColorMouseHoverSelectedTab = iPb.ReadProperty("IconColorMouseHoverSelectedTab", Empty) 120 | IconColorTabHighlighted = iPb.ReadProperty("IconColorTabHighlighted", Empty) 121 | End Sub 122 | -------------------------------------------------------------------------------- /control-source/cls/cUniTextBox.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "cUniTextBox" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = False 14 | Option Explicit 15 | 16 | ' A simple callback class used to offer unicode textbox on the property page 17 | ' It is truly simple and only has a couple properties/methods, but works well 18 | 19 | ' Should you want to use this for your own projects, here is how you can set it up 20 | ' 1) Add a borderless picturebox to your form/propertypage/usercontrol 21 | ' 2) Set that picturebox backcolor to the color you want for your textbox 22 | ' 3) Declare this class WithEvents in your project 23 | ' 4) Call this class' CreateTextBox function, ensure you pass pixel sizes 24 | ' 5) Monitor the 3 public events below 25 | ' 6) Synchronize GotFocus/LostFocus with the picturebox to ensure tabbing is maintained 26 | ' 7) Declare a boolean value in your project and set its values as so: 27 | ' -- When getting class GotFocus event: 28 | ' If yourBoolean = False Then 29 | ' set focus to your picturebox (i.e., Picture1.SetFocus) 30 | ' End If 31 | ' -- When getting class LostFocus event: 32 | ' set yourBoolean = False 33 | ' -- In your picturebox' GotFocus event: 34 | ' If yourBoolean = False Then 35 | ' set yourBoolean = True 36 | ' call this class' SetFocus routine 37 | ' End If 38 | ' 8) Add this procedure into a module & include appropriate APIs from that procedure 39 | ' Public Function UniTextBoxWindowProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long 40 | ' 41 | ' Dim refObject As Object, unRefObj As Object 42 | ' Dim lProc As Long, bUnicode As Boolean 43 | ' 44 | ' CopyMemory unRefObj, GetProp(hWnd, "cUniTextBox"), 4& 45 | ' Set refObject = unRefObj 46 | ' CopyMemory unRefObj, 0&, 4& 47 | ' 48 | ' UniTextBoxWindowProc = refObject.DoWindowMsg(hWnd, uMsg, wParam, lParam, bUnicode, lProc) 49 | ' Set refObject = Nothing 50 | ' If lProc Then 51 | ' If bUnicode Then 52 | ' UniTextBoxWindowProc = CallUniTextBoxWindowProcW(lProc, hWnd, uMsg, wParam, lParam) 53 | ' Else 54 | ' UniTextBoxWindowProc = CallUniTextBoxWindowProc(lProc, hWnd, uMsg, wParam, lParam) 55 | ' End If 56 | ' End If 57 | ' 58 | ' End Function 59 | ' 9) Use one class instance per textbox 60 | 61 | 62 | Public Event Change() 63 | Public Event GotFocus() 64 | Public Event LostFocus() 65 | 66 | Private Declare Function SetProp Lib "user32.dll" Alias "SetPropA" (ByVal hWnd As Long, ByVal lpString As String, ByVal hData As Long) As Long 67 | 'Private Declare Function GetProp Lib "user32.dll" Alias "GetPropA" (ByVal hWnd As Long, ByVal lpString As String) As Long 68 | Private Declare Function CreateWindowEx Lib "user32.dll" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, ByRef lpParam As Any) As Long 69 | Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long 70 | Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long 71 | Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long 72 | 73 | Private Declare Function CreateWindowExW Lib "user32.dll" (ByVal dwExStyle As Long, ByVal lpClassName As Long, ByVal lpWindowName As Long, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, ByRef lpParam As Any) As Long 74 | Private Declare Function SendMessageW Lib "user32.dll" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long 75 | Private Declare Function SetWindowLongW Lib "user32.dll" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long 76 | Private Declare Function GetWindowLongW Lib "user32.dll" (ByVal hWnd As Long, ByVal nIndex As Long) As Long 77 | 78 | Private Const WM_GETFONT As Long = &H31 79 | Private Const WM_SETFONT As Long = &H30 80 | Private Const WM_GETTEXTLENGTH As Long = &HE 81 | Private Const WM_GETTEXT As Long = &HD 82 | Private Const WM_SETTEXT As Long = &HC 83 | 84 | Private Declare Function DestroyWindow Lib "user32.dll" (ByVal hWnd As Long) As Long 85 | Private Declare Function GetDesktopWindow Lib "user32.dll" () As Long 86 | Private Declare Function IsWindowUnicode Lib "user32.dll" (ByVal hWnd As Long) As Long 87 | Private Declare Function SetFocusAPI Lib "user32.dll" Alias "SetFocus" (ByVal hWnd As Long) As Long 88 | 89 | Private Const WM_KILLFOCUS As Long = &H8 90 | Private Const WM_SETFOCUS As Long = &H7 91 | Private Const EN_CHANGE As Long = &H300 92 | Private Const WM_COMMAND As Long = &H111 93 | Private Const GWL_WNDPROC As Long = -4 94 | Private Const WM_DESTROY As Long = &H2 95 | Private Const WS_CHILD As Long = &H40000000 96 | 97 | Public Enum TextBoxStyleEnum 98 | ES_AUTOHSCROLL = &H80& 99 | ES_AUTOVSCROLL = &H40& 100 | ES_CENTER = &H1& 101 | ES_LEFT = &H0& 102 | ES_LOWERCASE = &H10& 103 | ES_MULTILINE = &H4& 104 | ES_NOHIDESEL = &H100& 105 | ES_NUMBER = &H2000& 106 | ES_PASSWORD = &H20& 107 | ES_READONLY = &H800& 108 | ES_RIGHT = &H2& 109 | ES_SUNKEN = &H4000& 110 | ES_UPPERCASE = &H8& 111 | ES_WANTRETURN = &H1000& 112 | WS_DISABLED = &H8000000 113 | WS_DLGFRAME = &H400000 114 | WS_HSCROLL = &H100000 115 | WS_THICKFRAME = &H40000 116 | WS_VISIBLE = &H10000000 117 | WS_VSCROLL = &H200000 118 | End Enum 119 | Public Enum TextBoxStyleExEnum 120 | WS_EX_CLIENTEDGE = &H200& 121 | WS_EX_LAYOUTRTL = &H400000 122 | WS_EX_LEFTSCROLLBAR = &H4000& 123 | WS_EX_NOPARENTNOTIFY = &H4& 124 | WS_EX_RIGHT = &H1000& 125 | WS_EX_RTLREADING = &H2000& 126 | WS_EX_STATICEDGE = &H20000 127 | End Enum 128 | 129 | Private m_Hwnd As Long 130 | Private m_Parent As Long 131 | Private m_Unicode As Boolean 132 | Private m_WinProc As Long 133 | Private m_WinProcParent As Long 134 | 135 | Public Function CreateTextBox(ByVal ContainerHwnd As Long, ByVal X As Long, ByVal Y As Long, _ 136 | ByVal Width As Long, ByVal Height As Long, _ 137 | ByVal Style As TextBoxStyleEnum, _ 138 | ByVal ExtendedStyle As TextBoxStyleExEnum, _ 139 | Optional ByVal Text As String = vbNullString) As Long 140 | 141 | pvUnSubclass True 142 | If m_Unicode Then 143 | m_Hwnd = CreateWindowExW(ExtendedStyle, StrPtr("Edit"), StrPtr(Text), Style Or WS_CHILD, X, Y, Width, Height, ContainerHwnd, 0&, App.hInstance, ByVal 0&) 144 | Else 145 | m_Hwnd = CreateWindowEx(ExtendedStyle, "Edit", Text, Style Or WS_CHILD, X, Y, Width, Height, ContainerHwnd, 0&, App.hInstance, ByVal 0&) 146 | End If 147 | If m_Hwnd Then 148 | m_Parent = ContainerHwnd 149 | SetProp m_Hwnd, "cUniTextBox", ObjPtr(Me) 150 | If m_Unicode Then 151 | SendMessageW m_Hwnd, WM_SETFONT, SendMessage(m_Parent, WM_GETFONT, 0&, ByVal 0&), ByVal 0& 152 | m_WinProc = GetWindowLongW(m_Hwnd, GWL_WNDPROC) 153 | SetWindowLongW m_Hwnd, GWL_WNDPROC, AddressOf UniTextBoxWindowProc 154 | Else 155 | SendMessage m_Hwnd, WM_SETFONT, SendMessage(m_Parent, WM_GETFONT, 0&, ByVal 0&), ByVal 0& 156 | m_WinProc = GetWindowLong(m_Hwnd, GWL_WNDPROC) 157 | SetWindowLong m_Hwnd, GWL_WNDPROC, AddressOf UniTextBoxWindowProc 158 | End If 159 | 160 | SetProp m_Parent, "cUniTextBox", ObjPtr(Me) 161 | m_WinProcParent = GetWindowLong(m_Parent, GWL_WNDPROC) 162 | SetWindowLong m_Parent, GWL_WNDPROC, AddressOf UniTextBoxWindowProc 163 | 164 | CreateTextBox = m_Hwnd 165 | End If 166 | 167 | End Function 168 | 169 | Private Sub pvUnSubclass(bDestroy As Boolean) 170 | If m_Hwnd Then 171 | If m_Unicode Then 172 | SetWindowLongW m_Hwnd, GWL_WNDPROC, m_WinProc 173 | Else 174 | SetWindowLong m_Hwnd, GWL_WNDPROC, m_WinProc 175 | End If 176 | If bDestroy Then DestroyWindow m_Hwnd 177 | m_Hwnd = 0& 178 | SetWindowLong m_Parent, GWL_WNDPROC, m_WinProcParent 179 | End If 180 | 181 | End Sub 182 | 183 | Public Function DoWindowMsg(hWnd As Long, uMsg As Long, wParam As Long, lParam As Long, Unicode As Boolean, wndProc As Long) As Long 184 | 185 | 186 | Select Case uMsg 187 | 188 | Case WM_SETFOCUS 189 | If hWnd = m_Hwnd Then RaiseEvent GotFocus 190 | Case WM_KILLFOCUS 191 | If hWnd = m_Hwnd Then RaiseEvent LostFocus 192 | Case WM_COMMAND 193 | If lParam = m_Hwnd And hWnd = m_Parent Then 194 | If (wParam And &H7FFF0000) \ &H10000 = EN_CHANGE Then RaiseEvent Change 195 | End If 196 | Case WM_DESTROY 197 | pvUnSubclass False 198 | 199 | End Select 200 | 201 | If hWnd = m_Hwnd Then 202 | Unicode = m_Unicode 203 | wndProc = m_WinProc ' set to zero if eating the message & set return value appropriately 204 | Else 205 | Unicode = False 206 | wndProc = m_WinProcParent 207 | End If 208 | 209 | End Function 210 | 211 | Public Property Get Text() As String 212 | If m_Hwnd Then 213 | Dim lLength As Long 214 | If m_Unicode Then 215 | lLength = SendMessageW(m_Hwnd, WM_GETTEXTLENGTH, 0&, ByVal 0&) 216 | If lLength Then 217 | Text = String$(lLength, 0) 218 | SendMessageW m_Hwnd, WM_GETTEXT, lLength + 1&, ByVal StrPtr(Text) 219 | End If 220 | Else 221 | lLength = SendMessage(m_Hwnd, WM_GETTEXTLENGTH, 0&, ByVal 0&) 222 | If lLength Then 223 | Text = String$(lLength, 0) 224 | SendMessage m_Hwnd, WM_GETTEXT, lLength + 1&, ByVal StrPtr(Text) 225 | End If 226 | End If 227 | End If 228 | End Property 229 | 230 | Public Property Let Text(newVal As String) 231 | 232 | If m_Hwnd Then 233 | If m_Unicode Then 234 | SendMessageW m_Hwnd, WM_SETTEXT, 0&, ByVal StrPtr(newVal) 235 | Else 236 | SendMessage m_Hwnd, WM_SETTEXT, 0&, ByVal newVal 237 | End If 238 | End If 239 | 240 | End Property 241 | 242 | 243 | Public Sub SetFocus() 244 | If m_Hwnd Then SetFocusAPI m_Hwnd 245 | End Sub 246 | 247 | Private Sub Class_Initialize() 248 | m_Unicode = Not (IsWindowUnicode(GetDesktopWindow) = 0&) 249 | End Sub 250 | 251 | Private Sub Class_Terminate() 252 | pvUnSubclass True 253 | End Sub 254 | -------------------------------------------------------------------------------- /control-source/cmp/NewTab01.cmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/cmp/NewTab01.cmp -------------------------------------------------------------------------------- /control-source/ctl/ctlNewTab.ctx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/ctl/ctlNewTab.ctx -------------------------------------------------------------------------------- /control-source/frm/frmNewTabSelectControl.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form frmNewTabSelectControl 3 | Caption = "Select control" 4 | ClientHeight = 3444 5 | ClientLeft = 8688 6 | ClientTop = 3612 7 | ClientWidth = 5856 8 | BeginProperty Font 9 | Name = "Tahoma" 10 | Size = 7.8 11 | Charset = 0 12 | Weight = 400 13 | Underline = 0 'False 14 | Italic = 0 'False 15 | Strikethrough = 0 'False 16 | EndProperty 17 | Icon = "frmNewTabSelectControl.frx":0000 18 | LinkTopic = "Form1" 19 | LockControls = -1 'True 20 | ScaleHeight = 3444 21 | ScaleWidth = 5856 22 | Begin VB.ListBox lstControls 23 | Height = 2736 24 | Left = 0 25 | TabIndex = 2 26 | Top = 0 27 | Width = 5844 28 | End 29 | Begin VB.CommandButton cmdCancel 30 | Cancel = -1 'True 31 | Caption = "&Cancel" 32 | Height = 435 33 | Left = 4044 34 | TabIndex = 1 35 | Top = 2880 36 | Width = 1515 37 | End 38 | Begin VB.CommandButton cmdOK 39 | Caption = "&OK" 40 | Default = -1 'True 41 | Height = 435 42 | Left = 2448 43 | TabIndex = 0 44 | Top = 2880 45 | Width = 1515 46 | End 47 | End 48 | Attribute VB_Name = "frmNewTabSelectControl" 49 | Attribute VB_GlobalNameSpace = False 50 | Attribute VB_Creatable = False 51 | Attribute VB_PredeclaredId = True 52 | Attribute VB_Exposed = False 53 | Option Explicit 54 | 55 | Public SelectedControl As String 56 | 57 | Private Sub cmdCancel_Click() 58 | Unload Me 59 | End Sub 60 | 61 | Private Sub cmdOK_Click() 62 | Dim iLng As Long 63 | 64 | If lstControls.ListIndex > -1 Then 65 | SelectedControl = lstControls.Text 66 | iLng = InStr(SelectedControl, "[now") 67 | If iLng > 0 Then 68 | SelectedControl = Trim$(Left$(SelectedControl, iLng - 1)) 69 | End If 70 | End If 71 | Unload Me 72 | End Sub 73 | 74 | Private Sub Form_Load() 75 | Me.Move Screen.Width / 2 - Me.Width / 2, Screen.Height / 2 - Me.Height / 2 76 | End Sub 77 | -------------------------------------------------------------------------------- /control-source/frm/frmNewTabSelectControl.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/frm/frmNewTabSelectControl.frx -------------------------------------------------------------------------------- /control-source/img/ToolboxBitmap.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/img/ToolboxBitmap.bmp -------------------------------------------------------------------------------- /control-source/lib/ReadMe_VBA6_dll.txt: -------------------------------------------------------------------------------- 1 | Tab is a reserved keyword in VB6, but you can remove that restriction. 2 | To be able to compile with Tab property, you need to replace VBA6.DLL with this version. 3 | VBA6.DLL is in VB6's installation folder, usually: 4 | C:\Program Files (x86)\Microsoft Visual Studio\VB98\ 5 | 6 | Note: this DLL is for SP6, so it is assumed that you already have SP6 (Service Pack 6) installed for your VB6 IDE. 7 | 8 | Also, you need to change the line: 9 | #Const COMPILE_WITH_TAB_PROPERTY = 0 10 | to: 11 | #Const COMPILE_WITH_TAB_PROPERTY = 1 12 | 13 | That line is almost at the end of the NewTab UserControl code module. 14 | 15 | In addition, if you want to preserve the binary compatibility, you'll need to go the the Project menu, Properties, Component tab, and set the "Binary compatibility" option. -------------------------------------------------------------------------------- /control-source/lib/VBA6.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/lib/VBA6.DLL -------------------------------------------------------------------------------- /control-source/pag/pagHighlightMode.pag: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.PropertyPage pagHighlightMode 3 | BackColor = &H80000005& 4 | Caption = "Property" 5 | ClientHeight = 4476 6 | ClientLeft = 0 7 | ClientTop = 0 8 | ClientWidth = 4416 9 | BeginProperty Font 10 | Name = "Segoe UI" 11 | Size = 9 12 | Charset = 0 13 | Weight = 400 14 | Underline = 0 'False 15 | Italic = 0 'False 16 | Strikethrough = 0 'False 17 | EndProperty 18 | PaletteMode = 0 'Halftone 19 | ScaleHeight = 4476 20 | ScaleWidth = 4416 21 | Begin VB.Timer tmrLoad 22 | Enabled = 0 'False 23 | Interval = 1 24 | Left = 240 25 | Top = 360 26 | End 27 | Begin VB.PictureBox picHighlightDropDown 28 | Appearance = 0 'Flat 29 | BackColor = &H80000005& 30 | BorderStyle = 0 'None 31 | Height = 4092 32 | Left = 0 33 | ScaleHeight = 4092 34 | ScaleWidth = 4416 35 | TabIndex = 0 36 | TabStop = 0 'False 37 | Top = 360 38 | Width = 4420 39 | Begin VB.CheckBox chkBackground 40 | BackColor = &H80000005& 41 | Caption = "Background" 42 | Height = 252 43 | Left = 120 44 | TabIndex = 11 45 | Top = 480 46 | Width = 4212 47 | End 48 | Begin VB.CheckBox chkBackgroundGradient 49 | BackColor = &H80000005& 50 | Caption = "Width gradient" 51 | Enabled = 0 'False 52 | Height = 252 53 | Left = 360 54 | TabIndex = 10 55 | Top = 840 56 | Width = 3900 57 | End 58 | Begin VB.CheckBox chkBackgroundGradientDouble 59 | BackColor = &H80000005& 60 | Caption = "Double (change at the middle)" 61 | Enabled = 0 'False 62 | Height = 252 63 | Left = 600 64 | TabIndex = 9 65 | Top = 1200 66 | Width = 3600 67 | End 68 | Begin VB.CheckBox chkBackgroundLight 69 | BackColor = &H80000005& 70 | Caption = "Light" 71 | Enabled = 0 'False 72 | Height = 252 73 | Left = 360 74 | TabIndex = 8 75 | Top = 1560 76 | Width = 3900 77 | End 78 | Begin VB.CheckBox chkCaptionBold 79 | BackColor = &H80000005& 80 | Caption = "CaptionBold" 81 | Height = 252 82 | Left = 120 83 | TabIndex = 7 84 | Top = 1920 85 | Width = 4212 86 | End 87 | Begin VB.CheckBox chkCaptionUnderlined 88 | BackColor = &H80000005& 89 | Caption = "CaptionUnderlined" 90 | Height = 252 91 | Left = 120 92 | TabIndex = 6 93 | Top = 2280 94 | Width = 4212 95 | End 96 | Begin VB.CheckBox chkFlatBar 97 | BackColor = &H80000005& 98 | Caption = "FlatBar" 99 | Height = 252 100 | Left = 120 101 | TabIndex = 5 102 | Top = 2640 103 | Width = 4212 104 | End 105 | Begin VB.CheckBox chkFlatBarGrip 106 | BackColor = &H80000005& 107 | Caption = "With grip" 108 | Enabled = 0 'False 109 | Height = 252 110 | Left = 360 111 | TabIndex = 4 112 | Top = 3000 113 | Width = 3900 114 | End 115 | Begin VB.CheckBox chkExtraHeight 116 | BackColor = &H80000005& 117 | Caption = "ExtraHeight" 118 | Height = 252 119 | Left = 120 120 | TabIndex = 3 121 | Top = 3360 122 | Width = 4212 123 | End 124 | Begin VB.CheckBox chkFlatDrawBorder 125 | BackColor = &H80000005& 126 | Caption = "FlatDrawBorder" 127 | Height = 252 128 | Left = 120 129 | TabIndex = 2 130 | Top = 3720 131 | Width = 4212 132 | End 133 | Begin VB.CheckBox chkHighlightAuto 134 | BackColor = &H80000005& 135 | Caption = "Auto" 136 | Height = 252 137 | Left = 120 138 | TabIndex = 1 139 | Top = 120 140 | Width = 4212 141 | End 142 | End 143 | Begin VB.Label lblProperyName 144 | BackStyle = 0 'Transparent 145 | BeginProperty Font 146 | Name = "Segoe UI" 147 | Size = 9 148 | Charset = 0 149 | Weight = 700 150 | Underline = 0 'False 151 | Italic = 0 'False 152 | Strikethrough = 0 'False 153 | EndProperty 154 | Height = 252 155 | Left = 0 156 | TabIndex = 12 157 | Top = 120 158 | Width = 3612 159 | End 160 | End 161 | Attribute VB_Name = "pagHighlightMode" 162 | Attribute VB_GlobalNameSpace = False 163 | Attribute VB_Creatable = True 164 | Attribute VB_PredeclaredId = False 165 | Attribute VB_Exposed = True 166 | Option Explicit 167 | 168 | Private mPropertyName As String 169 | Private mPropertyValue As Long 170 | 171 | Private Sub chkBackgroundGradientDouble_Click() 172 | Changed = True 173 | End Sub 174 | 175 | Private Sub chkBackgroundLight_Click() 176 | Changed = True 177 | End Sub 178 | 179 | Private Sub chkCaptionBold_Click() 180 | Changed = True 181 | End Sub 182 | 183 | Private Sub chkCaptionUnderlined_Click() 184 | Changed = True 185 | End Sub 186 | 187 | Private Sub chkExtraHeight_Click() 188 | Changed = True 189 | End Sub 190 | 191 | Private Sub chkFlatBarGrip_Click() 192 | Changed = True 193 | End Sub 194 | 195 | Private Sub chkFlatDrawBorder_Click() 196 | Changed = True 197 | End Sub 198 | 199 | Private Sub PropertyPage_ApplyChanges() 200 | Dim iCtl As NewTab 201 | 202 | PropertyPage.Changed = False 203 | SetVariables 204 | 205 | Set iCtl = SelectedControls(0) 206 | If mPropertyName = "HighlightMode" Then 207 | iCtl.HighlightMode = mPropertyValue 208 | ElseIf mPropertyName = "HighlightModeSelectedTab" Then 209 | iCtl.HighlightModeSelectedTab = mPropertyValue 210 | End If 211 | PropertyPage.Changed = False 212 | End Sub 213 | 214 | Private Sub PropertyPage_EditProperty(PropertyName As String) 215 | mPropertyName = PropertyName 216 | tmrLoad.Enabled = True 217 | picHighlightDropDown.Move (PropertyPage.ScaleWidth - picHighlightDropDown.Width) / 2 218 | lblProperyName.Left = 120 219 | End Sub 220 | 221 | Private Sub LoadHighlightDropDown(ByVal nFlags As NTHighlightModeFlagsConstants) 222 | If nFlags = ntHLAuto Then 223 | chkHighlightAuto.Value = vbChecked 224 | chkBackground.Value = vbUnchecked 225 | chkBackgroundGradient.Value = vbUnchecked 226 | chkBackgroundGradientDouble.Value = vbUnchecked 227 | chkBackgroundLight.Value = vbUnchecked 228 | chkCaptionBold.Value = vbUnchecked 229 | chkCaptionUnderlined.Value = vbUnchecked 230 | chkFlatBar.Value = vbUnchecked 231 | chkFlatBarGrip.Value = vbUnchecked 232 | chkExtraHeight.Value = vbUnchecked 233 | chkFlatDrawBorder.Value = vbUnchecked 234 | ElseIf nFlags = ntHLNone Then 235 | chkHighlightAuto.Value = vbUnchecked 236 | chkBackground.Value = vbUnchecked 237 | chkBackgroundGradient.Value = vbUnchecked 238 | chkBackgroundGradientDouble.Value = vbUnchecked 239 | chkBackgroundLight.Value = vbUnchecked 240 | chkCaptionBold.Value = vbUnchecked 241 | chkCaptionUnderlined.Value = vbUnchecked 242 | chkFlatBar.Value = vbUnchecked 243 | chkFlatBarGrip.Value = vbUnchecked 244 | chkExtraHeight.Value = vbUnchecked 245 | chkFlatDrawBorder.Value = vbUnchecked 246 | Else 247 | chkHighlightAuto.Value = vbUnchecked 248 | chkBackground.Value = CLng((nFlags And ntHLBackgroundTypeFilter) <> 0) * -1 249 | If chkBackground.Value Then 250 | chkBackgroundGradient.Value = CLng((nFlags And ntHLBackgroundGradient) <> 0) * -1 251 | If chkBackgroundGradient.Value Then 252 | chkBackgroundGradientDouble.Value = CLng((nFlags And ntHLBackgroundDoubleGradient) = ntHLBackgroundDoubleGradient) * -1 253 | End If 254 | chkBackgroundLight.Value = CLng((nFlags And ntHLBackgroundLight) <> 0) * -1 255 | End If 256 | chkCaptionBold.Value = CLng((nFlags And ntHLCaptionBold) <> 0) * -1 257 | chkCaptionUnderlined.Value = CLng((nFlags And ntHLCaptionUnderlined) <> 0) * -1 258 | chkFlatBar.Value = CLng((nFlags And ntHLFlatBar) <> 0) * -1 259 | If chkFlatBar.Value Then 260 | chkFlatBarGrip.Value = CLng((nFlags And ntHLFlatBarGrip) <> 0) * -1 261 | End If 262 | chkExtraHeight.Value = CLng((nFlags And ntHLExtraHeight) <> 0) * -1 263 | chkFlatDrawBorder.Value = CLng((nFlags And ntHLFlatDrawBorder) <> 0) * -1 264 | End If 265 | End Sub 266 | 267 | Private Sub SetVariables() 268 | Dim iValue As NTHighlightModeFlagsConstants 269 | 270 | If chkHighlightAuto.Value = vbChecked Then 271 | iValue = ntHLAuto 272 | Else 273 | If chkBackground.Value = vbChecked Then 274 | If chkBackgroundGradient.Value = vbChecked Then 275 | If chkBackgroundGradientDouble.Value = vbChecked Then 276 | iValue = ntHLBackgroundDoubleGradient 277 | Else 278 | iValue = ntHLBackgroundGradient 279 | End If 280 | Else 281 | iValue = ntHLBackgroundPlain 282 | End If 283 | If chkBackgroundLight.Value = vbChecked Then 284 | iValue = iValue Or ntHLBackgroundLight 285 | End If 286 | End If 287 | If chkCaptionBold.Value = vbChecked Then 288 | iValue = iValue Or ntHLCaptionBold 289 | End If 290 | If chkCaptionUnderlined.Value = vbChecked Then 291 | iValue = iValue Or ntHLCaptionUnderlined 292 | End If 293 | If chkFlatBar.Value = vbChecked Then 294 | iValue = iValue Or ntHLFlatBar 295 | If chkFlatBarGrip.Value = vbChecked Then 296 | iValue = iValue Or ntHLFlatBarGrip 297 | End If 298 | End If 299 | If chkExtraHeight.Value = vbChecked Then 300 | iValue = iValue Or ntHLExtraHeight 301 | End If 302 | If chkFlatDrawBorder.Value = vbChecked Then 303 | iValue = iValue Or ntHLFlatDrawBorder 304 | End If 305 | If iValue = ntHLAuto Then iValue = ntHLNone 306 | End If 307 | 308 | If mPropertyValue <> iValue Then 309 | mPropertyValue = iValue 310 | Changed = True 311 | End If 312 | End Sub 313 | 314 | Private Sub tmrLoad_Timer() 315 | Dim iCtl As NewTab 316 | 317 | tmrLoad.Enabled = False 318 | Set iCtl = SelectedControls(0) 319 | If mPropertyName = "HighlightMode" Then 320 | mPropertyValue = iCtl.HighlightMode 321 | ElseIf mPropertyName = "HighlightModeSelectedTab" Then 322 | mPropertyValue = iCtl.HighlightModeSelectedTab 323 | End If 324 | LoadHighlightDropDown mPropertyValue 325 | lblProperyName.Caption = mPropertyName & ":" 326 | PropertyPage.Refresh 327 | Changed = False 328 | End Sub 329 | 330 | 331 | Private Sub chkFlatBar_Click() 332 | chkFlatBarGrip.Enabled = (chkFlatBar.Value = vbChecked) And (chkHighlightAuto.Value <> vbChecked) 333 | Changed = True 334 | End Sub 335 | 336 | Private Sub chkHighlightAuto_Click() 337 | chkBackground.Enabled = (chkHighlightAuto.Value <> vbChecked) 338 | chkBackground_Click 339 | chkCaptionBold.Enabled = chkBackground.Enabled 340 | chkCaptionUnderlined.Enabled = chkBackground.Enabled 341 | chkFlatBar.Enabled = chkBackground.Enabled 342 | chkFlatBar_Click 343 | chkExtraHeight.Enabled = chkBackground.Enabled 344 | chkFlatDrawBorder.Enabled = chkBackground.Enabled 345 | Changed = True 346 | End Sub 347 | 348 | Private Sub chkBackground_Click() 349 | chkBackgroundGradient.Enabled = (chkBackground.Value = vbChecked) And (chkHighlightAuto.Value <> vbChecked) 350 | chkBackgroundLight.Enabled = (chkBackground.Value = vbChecked) And (chkHighlightAuto.Value <> vbChecked) 351 | chkBackgroundGradientDouble.Enabled = (chkBackground.Value = vbChecked) And (chkBackgroundGradient.Value = vbChecked) And (chkHighlightAuto.Value <> vbChecked) 352 | Changed = True 353 | End Sub 354 | 355 | Private Sub chkBackgroundGradient_Click() 356 | chkBackgroundGradientDouble.Enabled = (chkBackground.Value = vbChecked) And (chkBackgroundGradient.Value = vbChecked) 357 | Changed = True 358 | End Sub 359 | 360 | -------------------------------------------------------------------------------- /control-source/pag/pagHighlightMode.pgx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /control-source/pag/pagNewTabGeneral.pgx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /control-source/pag/pagNewTabHelp.pag: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.PropertyPage pagNewTabHelp 3 | Caption = "Help" 4 | ClientHeight = 8160 5 | ClientLeft = 0 6 | ClientTop = 0 7 | ClientWidth = 6804 8 | BeginProperty Font 9 | Name = "Arial" 10 | Size = 7.8 11 | Charset = 0 12 | Weight = 400 13 | Underline = 0 'False 14 | Italic = 0 'False 15 | Strikethrough = 0 'False 16 | EndProperty 17 | LockControls = -1 'True 18 | PaletteMode = 0 'Halftone 19 | ScaleHeight = 8160 20 | ScaleWidth = 6804 21 | Begin VB.Timer tmrInit 22 | Interval = 30 23 | Left = 6480 24 | Top = 480 25 | End 26 | Begin VB.TextBox txtText 27 | Height = 1690 28 | Index = 1 29 | Left = 600 30 | MultiLine = -1 'True 31 | ScrollBars = 2 'Vertical 32 | TabIndex = 2 33 | Text = "pagNewTabHelp.pgx":0000 34 | Top = 2040 35 | Visible = 0 'False 36 | Width = 4930 37 | End 38 | Begin VB.TextBox txtText 39 | Height = 1690 40 | Index = 0 41 | Left = 600 42 | MultiLine = -1 'True 43 | ScrollBars = 2 'Vertical 44 | TabIndex = 1 45 | Text = "pagNewTabHelp.pgx":4768 46 | Top = 240 47 | Visible = 0 'False 48 | Width = 4930 49 | End 50 | Begin VB.TextBox txtHelp 51 | BeginProperty Font 52 | Name = "Lucida Console" 53 | Size = 9 54 | Charset = 0 55 | Weight = 400 56 | Underline = 0 'False 57 | Italic = 0 'False 58 | Strikethrough = 0 'False 59 | EndProperty 60 | Height = 8000 61 | Left = 36 62 | Locked = -1 'True 63 | MultiLine = -1 'True 64 | ScrollBars = 2 'Vertical 65 | TabIndex = 0 66 | Top = 72 67 | Width = 6590 68 | End 69 | End 70 | Attribute VB_Name = "pagNewTabHelp" 71 | Attribute VB_GlobalNameSpace = False 72 | Attribute VB_Creatable = True 73 | Attribute VB_PredeclaredId = False 74 | Attribute VB_Exposed = True 75 | Option Explicit 76 | 77 | Private Sub PropertyPage_SelectionChanged() 78 | txtHelp.Move 0, 0, PropertyPage.ScaleWidth, PropertyPage.ScaleHeight 79 | End Sub 80 | 81 | Private Sub tmrInit_Timer() 82 | tmrInit.Enabled = False 83 | txtHelp.Text = Replace$(txtText(0).Text & vbCrLf & vbCrLf & txtText(1).Text, Chr$(1), vbTab) 84 | End Sub 85 | -------------------------------------------------------------------------------- /control-source/pag/pagNewTabHelp.pgx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/pag/pagNewTabHelp.pgx -------------------------------------------------------------------------------- /control-source/pag/pagNewTabIcons.pgx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/pag/pagNewTabIcons.pgx -------------------------------------------------------------------------------- /control-source/pag/pagNewTabTabs.pag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/pag/pagNewTabTabs.pag -------------------------------------------------------------------------------- /control-source/pag/pagNewTabTabs.pgx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/pag/pagNewTabTabs.pgx -------------------------------------------------------------------------------- /control-source/subclass/cIBSSubclass.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "IBSSubclass" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = True 14 | Option Explicit 15 | 16 | Public Function MsgResponse(ByVal hWnd As Long, ByVal iMsg As Long) As Long 17 | ' 18 | End Function 19 | 20 | Function WindowProc(ByVal hWnd As Long, ByVal iMsg As Long, ByRef wParam As Long, ByRef lParam As Long, ByRef bConsume As Boolean) As Long 21 | Attribute WindowProc.VB_Description = "Raised whenever a message you have subclassed is sent." 22 | ' 23 | End Function 24 | 25 | Public Sub UnsubclassIt() 26 | 27 | End Sub 28 | -------------------------------------------------------------------------------- /control-source/subclass/cTimer.cls: -------------------------------------------------------------------------------- 1 | VERSION 1.0 CLASS 2 | BEGIN 3 | MultiUse = -1 'True 4 | Persistable = 0 'NotPersistable 5 | DataBindingBehavior = 0 'vbNone 6 | DataSourceBehavior = 0 'vbNone 7 | MTSTransactionMode = 0 'NotAnMTSObject 8 | END 9 | Attribute VB_Name = "cTimer" 10 | Attribute VB_GlobalNameSpace = False 11 | Attribute VB_Creatable = False 12 | Attribute VB_PredeclaredId = False 13 | Attribute VB_Exposed = False 14 | Option Explicit 15 | Private iInterval As Long 16 | Private ID As Long 17 | Private mTag As Variant 18 | 19 | Public Event ThatTime() 20 | 21 | ' SubTimer is independent of VBCore, so it hard codes error handling 22 | 23 | Public Enum EErrorTimer 24 | eeBaseTimer = 13650 ' CTimer 25 | eeTooManyTimers ' No more than 100 timers allowed per class 26 | eeCantCreateTimer ' Can't create system Timer 27 | End Enum 28 | 29 | Friend Sub ErrRaise(e As Long) 30 | Dim sText As String, sSource As String 31 | If e > 1000 Then 32 | sSource = App.EXEName & ".WindowProc" 33 | Select Case e 34 | Case eeTooManyTimers 35 | sText = "No more than 100 timers allowed per class" 36 | Case eeCantCreateTimer 37 | sText = "Can't create system Timer" 38 | End Select 39 | Err.Raise e Or vbObjectError, sSource, sText 40 | Else 41 | ' Raise standard Visual Basic error 42 | Err.Raise e, sSource 43 | End If 44 | End Sub 45 | 46 | 47 | Property Get Interval() As Long 48 | Attribute Interval.VB_Description = "Gets/sets the interval at which the timer fires. Set to zero to stop the timer." 49 | Interval = iInterval 50 | End Property 51 | 52 | ' Can't just change interval--you must kill Timer and start a new one 53 | Property Let Interval(iIntervalA As Long) 54 | Dim f As Boolean 55 | If iIntervalA > 0 Then 56 | ' Don't mess with it if interval is the same 57 | If iInterval = iIntervalA Then Exit Property 58 | ' Must destroy any existing Timer to change interval 59 | If iInterval Then 60 | f = TimerDestroy(Me) 61 | Debug.Assert f ' Shouldn't fail 62 | End If 63 | ' Create new Timer with new interval 64 | iInterval = iIntervalA 65 | If TimerCreate(Me) = False Then ErrRaise eeCantCreateTimer 66 | Else 67 | If (iInterval > 0) Then 68 | iInterval = 0 69 | f = TimerDestroy(Me) 70 | Debug.Assert f ' Shouldn't fail 71 | End If 72 | End If 73 | End Property 74 | 75 | ' Must be public so that Timer object can't terminate while client's ThatTime 76 | ' event is being processed--Friend wouldn't prevent this disaster 77 | Public Sub PulseTimer() 78 | Attribute PulseTimer.VB_MemberFlags = "40" 79 | RaiseEvent ThatTime 80 | End Sub 81 | 82 | Friend Property Get TimerID() As Long 83 | TimerID = ID 84 | End Property 85 | 86 | Friend Property Let TimerID(idA As Long) 87 | ID = idA 88 | End Property 89 | 90 | Private Sub Class_Terminate() 91 | Interval = 0 92 | End Sub 93 | 94 | Public Property Get Tag() As Variant 95 | Tag = mTag 96 | End Property 97 | 98 | Public Property Let Tag(nValue As Variant) 99 | mTag = nValue 100 | End Property 101 | 102 | -------------------------------------------------------------------------------- /control-source/subclass/mBSPropsDB.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "mBSPropsDB" 2 | Option Explicit 3 | 4 | Public gWinPropsDB As New Collection 5 | 6 | Public Function MySetProp(nHwnd As Long, nPropertyName As String, nData As Long) As Long 7 | 8 | On Error Resume Next 9 | Err.Clear 10 | gWinPropsDB.Add nData, CStr(nHwnd) & "|" & nPropertyName 11 | If Err.Number = 457 Then 12 | On Error GoTo ErrorExit: 13 | gWinPropsDB.Remove CStr(nHwnd) & "|" & nPropertyName 14 | gWinPropsDB.Add nData, CStr(nHwnd) & "|" & nPropertyName 15 | End If 16 | 'Debug.Print gWinPropsDB.count 17 | MySetProp = 1 18 | Exit Function 19 | 20 | ErrorExit: 21 | MySetProp = 0 22 | Err.Clear 23 | End Function 24 | 25 | Public Function MyGetProp(nHwnd As Long, nPropertyName As String) As Long 26 | 27 | On Error GoTo ErrorExit: 28 | MyGetProp = gWinPropsDB(CStr(nHwnd) & "|" & nPropertyName) 29 | Exit Function 30 | 31 | ErrorExit: 32 | MyGetProp = 0 33 | 'Debug.Print "Error MyGetProp, hWnd" & nHwnd & ", PropertyName: " & nPropertyName 34 | Err.Clear 35 | End Function 36 | 37 | Public Function MyRemoveProp(nHwnd As Long, nPropertyName As String) As Long 38 | 39 | On Error Resume Next 40 | MyRemoveProp = gWinPropsDB(CStr(nHwnd) & "|" & nPropertyName) 41 | On Error GoTo ErrorExit: 42 | gWinPropsDB.Remove CStr(nHwnd) & "|" & nPropertyName 43 | Exit Function 44 | 45 | ErrorExit: 46 | MyRemoveProp = 0 47 | Err.Clear 48 | End Function 49 | 50 | -------------------------------------------------------------------------------- /control-source/subclass/mBSSubclass.bas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/control-source/subclass/mBSSubclass.bas -------------------------------------------------------------------------------- /control-source/subclass/mTimer.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "mTimer" 2 | Option Explicit 3 | 4 | ' declares: 5 | Private Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long 6 | Private Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long 7 | 8 | Const cTimerMax = 100 9 | 10 | ' Array of timers 11 | Public aTimers(1 To cTimerMax) As cTimer 12 | ' Added SPM to prevent excessive searching through aTimers array: 13 | Private m_cTimerCount As Integer 14 | 15 | Function TimerCreate(Timer As cTimer) As Boolean 16 | ' Create the Timer 17 | 'Debug.Print m_cTimerCount 18 | Timer.TimerID = SetTimer(0&, 0&, Timer.Interval, AddressOf TimerProc) 19 | If Timer.TimerID Then 20 | TimerCreate = True 21 | Dim i As Integer 22 | For i = 1 To cTimerMax 23 | If aTimers(i) Is Nothing Then 24 | Set aTimers(i) = Timer 25 | If (i > m_cTimerCount) Then 26 | m_cTimerCount = i 27 | End If 28 | TimerCreate = True 29 | Exit Function 30 | End If 31 | Next 32 | Timer.ErrRaise eeTooManyTimers 33 | Else 34 | ' TimerCreate = False 35 | Timer.TimerID = 0 36 | Timer.Interval = 0 37 | End If 38 | End Function 39 | 40 | Public Function TimerDestroy(Timer As cTimer) As Long 41 | ' TimerDestroy = False 42 | ' Find and remove this Timer 43 | Dim i As Integer, f As Boolean 44 | ' SPM - no need to count past the last Timer set up in the 45 | ' aTimer array: 46 | For i = 1 To m_cTimerCount 47 | ' Find Timer in array 48 | If Not aTimers(i) Is Nothing Then 49 | If Timer.TimerID = aTimers(i).TimerID Then 50 | f = KillTimer(0, Timer.TimerID) 51 | ' Remove Timer and set reference to nothing 52 | Set aTimers(i) = Nothing 53 | TimerDestroy = True 54 | Exit Function 55 | End If 56 | ' SPM: aTimers(1) could well be nothing before 57 | ' aTimers(2) is. This original [else] would leave 58 | ' Timer 2 still running when the class terminates - 59 | ' not very nice! Causes serious GPF in IE and VB design 60 | ' mode... 61 | 'Else 62 | ' TimerDestroy = True 63 | ' Exit Function 64 | End If 65 | Next 66 | End Function 67 | 68 | 69 | Sub TimerProc(ByVal hWnd As Long, ByVal uMsg As Long, _ 70 | ByVal idEvent As Long, ByVal dwTime As Long) 71 | Dim i As Integer 72 | ' Find the Timer with this ID 73 | If m_cTimerCount = 0 Then 74 | Call KillTimer(0, idEvent) 75 | Else 76 | For i = 1 To m_cTimerCount 77 | ' SPM: Add a check to ensure aTimers(i) is not nothing! 78 | ' This would occur if we had two timers declared from 79 | ' the same thread and we terminated the first one before 80 | ' the second! Causes serious GPF if we don't do this... 81 | If Not (aTimers(i) Is Nothing) Then 82 | If idEvent = aTimers(i).TimerID Then 83 | ' Generate the event 84 | aTimers(i).PulseTimer 85 | Exit Sub 86 | End If 87 | End If 88 | Next 89 | End If 90 | End Sub 91 | 92 | 93 | 'Private Function StoreTimer(Timer As cTimer) 94 | ' Dim i As Integer 95 | ' For i = 1 To m_cTimerCount 96 | ' If aTimers(i) Is Nothing Then 97 | ' Set aTimers(i) = Timer 98 | ' StoreTimer = True 99 | ' Exit Function 100 | ' End If 101 | ' Next 102 | 'End Function 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /docs/Changelog.txt: -------------------------------------------------------------------------------- 1 | 2025-05-09 Changed to OLE version 14. 2 | 2025-05-09 Added ControlGetTab method. 3 | 2025-04-30 Fixed bug in ControlSetTab method. 4 | 2025-03-25 Changed to OLE version 13. 5 | 2025-03-24 Added more TabOrientation property options. 6 | 2025-03-24 Several minor bug fixes related to details in appearance. 7 | 2025-03-23 Fixed bug When showing property pages uncompiled without the NetTab UserControl having the Tab property (default code, #Const COMPILE_WITH_TAB_PROPERTY = 0). 8 | 2025-03-22 Fixed bug in Tabs property page deleting a tab when tabs have a TabKey assigned. 9 | 2025-03-12 Improvement in showing he sample in property pages Tabs and Tab Icons. 10 | 2025-03-01 Fixed a ug in TDI forms when closing a form is canceled by the user. 11 | 2025-02-01 Added in Refresh method the refresh of the TDI forms icons. 12 | 2025-01-28 Fixed bug when the ShowTabCloseButton parameter of the TDIBeforeNewTab event in TDI mode forms is True. 13 | 2025-01-28 Adjusted the space between the Iconfont icon and the caption in tabs. 14 | 2025-01-28 Adjusted the size of X (and +) in TDI mode. 15 | 2025-01-27 Now the X for closing tabs in TDI mode defaults to Marlett font first instead of Arial when Segoe MDL2 Assets is not present. 16 | 2025-01-27 Correction in the tab left position when the program is not manifested for showing Windows themes and the Style property setting is Windows. 17 | 2025-01-27 Improved the size of X for closing tabs in TDI mode when using Arial font. 18 | 2025-01-26 Fixed bug in icon color on mouse over when there is more than one row of tabs. 19 | 2025-01-26 Fixed bug related to X for closing tabs. 20 | 2025-01-26 Fixed bug in TDI forms, first tab was being closed after closing another tab. 21 | 2025-01-26 Changed to OLE version 12. 22 | 2025-01-26 Removed TDIModeFormsReady event. After latest changes it became unnecessary. 23 | 2025-01-23 Change in hooking/subclass for the parent TDI form to be ready earlier, and to be able to load TDI child forms in its Form_Load event. 24 | 2025-01-21 Fixed the icon alignment of the first tab in TDI mode forms. 25 | 2025-01-21 Changed to OLE version 11. 26 | 2025-01-21 Added ShowTabCloseButton parameter to the TDIBeforeNewTab event. 27 | 2025-01-21 Fixed bug regarding form's icon size in the tab in TDI mode forms. 28 | 2025-01-16 New NewTab controls placed on a MDIForm now default to Windows style. 29 | 2025-01-09 Adjustment in Style property setting. 30 | 2025-01-08 Reordered and fixes property Categories, as they appear in the property window. 31 | 2025-01-06 The Tab property now accepts the tab caption along with the TabKey and the tab number. 32 | 2025-01-06 Fixed bug i the 'SSTab with Windows styles' theme. 33 | 2024-12-29 Changed to OLE version 10. 34 | 2024-12-29 Updated documentation. 35 | 2024-12-29 All properties with names including 'TabSel' have been changed to 'SelectedTab' for clarity and better naming. The TabSel property is retained (hidden) for backward compatibility. 36 | 2024-12-29 SetActiveTab method renamed to SelectTab. 37 | 2024-12-29 Fixed bug in flat style when the control shows the bottom bar, when there is more than one rows of tabs. 38 | 2024-12-29 When the control is running in source code and #Const NOSUBCLASSINIDE = 1 (default, for IDE crash protection), now the currently selected tab can be changed at design time from the Tabs property page (from 'Current tab' control at the top left). 39 | 2024-12-29 Fixed bug in property pages Tabs and TabIcons when in the sample control shown at the bottom the current tab is not visible due to property page smaller width. 40 | 2024-12-29 Bug fix related to control font being changed to Ambient Font when applying themes. 41 | 2024-12-29 Event TDIFormsShowTabIcon now includes the possibility to use an IconFont for the icon. 42 | 2024-12-29 Added RefreshContainedControls method. 43 | 2024-12-26 Bug fix for mTDIMode = ntTDIModeForms setting icon of main tab at design time. 44 | 2024-12-20 Updated documentation to include the TDIModeFormsReady event. 45 | 2024-12-20 Added event TDIModeFormsReady. 46 | 2024-12-19 Better handling for TDIMode = ntTDIModeForms when the form has ControlBox = False. 47 | 2024-12-19 Fix in ControlSetTab method. 48 | 2024-12-18 Updated documentation. 49 | 2024-12-17 Added event TDIFormsShowTabIcon that allows for more control over the tab icon and its position for TDIMode = ntTDIModeForms. 50 | 2024-12-11 Fix in pagNewTabGeneral property page for comboboxes handling HightLightMode and HightLightModeTabSel properties, in some situations left clicking was seen twice. 51 | 2024-12-11 Fix when RightToLeft = True, for position in tabs captions when TDIMode = ntTDIModeForms, for the number that uniquely identifies a form when its name is repeated (like (1), (2)). 52 | 2024-12-11 Fix when RightToLeft = True, for the NewTab controls that appear as samples in pagNewTabIcons, pagNewTabTabs and pagNewTabThemes property pages. 53 | 2024-12-11 Fix in position of form icons (that appear in tabs) when TDIMode = ntTDIModeForms. 54 | 2024-12-11 Fix in 'Another Dark Button' theme definition. 55 | 2024-12-10 Improved GUI in pagNewTabIcons property page for TDI mode. 56 | 2024-12-10 Fixed left border issue when RightToLeft = True. 57 | 2024-12-10 Removed TabsPerRow property from Theme. 58 | 2024-12-09 Fixed click on tabs at design time when RightToLeft = True. 59 | 2024-08-13 Fix in raising Resize event. 60 | 2024-08-12 In the pagNewTabTabs property page now the default tab displayed is the current tab in the control. 61 | 2024-08-12 Added TabCaption label to pagNewTabIcons property page. 62 | 2024-06-12 Added a MIT license. 63 | 2024-08-08 Fixed bug in pagNewTabTabs propety page, when adding a new tab. 64 | 2024-04-25 Fixed: TabKey must be unique. 65 | 2024-04-25 TabKeys are now case insensitive. 66 | 2024-04-24 Changed to OLE version 9.0. 67 | 2024-04-24 Added property TabKey. That key can be used to set the current/active/selected tab with the 'Tab' property now. 68 | 2024-04-24 Added function GetTabOriginalIndex. 69 | 2024-04-24 Now TabTag, TabData, TabFixedWidth and TabCustomColor properties can be set at design time. 70 | 2024-04-24 Tabs property page split into two property pages (Icons went to a new property page). 71 | 2024-04-24 Fixed bug in TabCustomColor property. 72 | 2024-04-22 Improved in TDI mode forms when the form's caption is changed. 73 | 2024-04-22 Added TDIGetTabByFormHwnd function. 74 | 2024-04-11 Added TDIGetFormHwndByTab function. 75 | 2024-04-03 Fix in Theme/CaptionAlignment. 76 | 2024-04-02 Added CaptionAlignment property. 77 | 2024-03-27 In TDIMode forms, the first/home tab can be hidden now (TabVisible(0) = False). 78 | 2024-03-17 RightToLeft only available for TabOrientation top. 79 | 2024-03-17 TDI modes only available for TabOrientation top and bottom. 80 | 2024-03-17 CanReorderTabs now only works on TabOrientation top and bottom. 81 | 2024-03-14 Added a third parameter StartingTab to FindTab and SetActiveTab methods. 82 | 2024-03-14 Added ntFindPartialCaption and ntFindPartialCaptionReverse options to parameter 'Method' of FindTab and SetActiveTab methods. 83 | 2024-03-13 Bug fix regarding RightToLeft. 84 | 2024-03-12 Bug fix related to TabWidthStyle default setting. 85 | 2024-03-12 TabCustomColor property second parameter made optional, defaulting to ntCCBackColorTab. 86 | 2024-02-15 Added Align property. 87 | 2024-02-15 Changed property names Body[Left|Top|Width|Height] to Client[Left|Top|Width|Height]. 88 | 2024-02-08 Bug fix in TabMaxWidth property. 89 | 2024-02-08 Bug fix in FlatBorderMode = ntBorderTabs. 90 | 2024-02-07 Added TabCustomColor property. Now each tab can have its own colors. 91 | 2024-02-07 Bug fix when CanReorderTabs is True and the user clicks the icon of a non active tab. 92 | 2024-02-04 Bug fix in ChangeControlsForeColor procedure. 93 | 2024-02-03 Changed to OLE version 8.0. 94 | 2024-02-03 Changed property names TabBody[Left|Top|Width|Height] to Body[Left|Top|Width|Height]. 95 | 2024-02-03 Changed TabBodyResize event name to Resize. 96 | 2024-02-03 Background of LabelW now is painted the same as Label when the Windows visual style is active. 97 | 2024-02-03 Several minor bug fixes related to themes. 98 | 2024-02-01 Added property TabFixedWidth 99 | 2024-02-01 Fixed bug when WordWrap = False 100 | 2024-01-27 TabsPerRow is no longer considered a theme property. 101 | 2024-01-20 Bug fix in built-in themes data. 102 | 2024-01-19 Added GetThemeData/SetThemeData methods. 103 | 2024-01-18 Added GetTabsOrder/SetTabsOrder methods (CanReorderTabs must be True). 104 | 2024-01-18 Added FindTab method. 105 | 2024-01-13 Changed to OLE version 7.0. 106 | 2024-01-13 Added SetActiveTab method. 107 | 2024-01-13 Changed most of the Integer properties to Long, and new NewTab events (not available in the original SSTab) from Integer to Long. Old original SSTab events were left As Integer. 108 | 2024-01-13 Changed Event name TabSelChange to TabChange. If you used this event then you need to manually change its name in the event handler's code. 109 | 2024-01-13 TabSel property is hidden now, it is kept for compatibility but is deprecated. Use the Tab property instead. 110 | 2023-12-19 Fixes regarding tab-captions vertical centering. 111 | 2023-12-14 Fixed bug in botton oriented tabs icon positions. 112 | 2023-12-08 Changed to OLE version 6.0. 113 | 2023-12-08 TDIMode property changed from boolean to Long, now there are two TDI modes: controls and forms. 114 | 2023-12-08 Improvements in tab dragging (CanReorderTabs property). 115 | 2023-11-28 Changed to OLE version 5.0. 116 | 2023-11-27 Recently added TabsRightFreeSpace property renamed as TabsEndFreeSpace. 117 | 2023-11-27 Added ntTabOrientationLeftHorizontal and ntTabOrientationRightHorizontal options to the TabOrientation property. 118 | 2023-11-22 Several minor bugs fixed. 119 | 2023-11-05 Changed to OLE version 4.0. 120 | 2023-11-05 Fixed bug in Draw procedure when TabWidthStyle = 1. 121 | 2023-11-02 Bitmaps images in tabs are not grayed anymore when the whole control is disabled, only when the particular tab is disabled. 122 | 2023-11-01 Added property TabsRightFreeSpace, that allows to set a free space after the rightmost tab but without affecting the whole control width. 123 | 2023-10-14 Fix in TabTransition property. 124 | 2023-10-10 Fix in pagNewTabTabs property page. 125 | 2023-10-07 Added 4 more default themes. 126 | 2023-10-06 Minor fix in Tabs property page. 127 | 2023-10-03 Refresh method improved. 128 | 2023-09-20 Added theme "Apple Green" 129 | 2023-09-19 TabToolTipText now show at design time too. 130 | 2023-09-19 Change theme name Esmerald to Emerald. 131 | 2023-09-13 Fixed visual bug in left tab roundness of the Flat style. 132 | 2023-09-09 Fixed bug regarding TabTransition property when the setting > 0 and the NewTab control extends beyond the visible area of the form. 133 | 2023-05-19 Fixed bug regarding ForeColor automatic change when pasting controls in the designer. 134 | 2023-05-11 Added the property SubclassingMethod. 135 | 2023-05-11 Fixed bug in Theme property page when the default theme is the current theme. 136 | 2023-04-26 Fixed Icon orientation in TabOrientation <> top 137 | 2022-12-21 Added protection for in IDE undeterministic project objects shut-down. 138 | 2022-12-17 Set DblClick event as default to match SSTab. 139 | 2022-12-02 Fixed a bug in property page pagNewTabTabs, 'Move the controls to another tab' command function. 140 | 2022-11-30 Added Unicode support for text input for the Caption and TabToolTipText properties on the Tabs property page. 141 | 2022-11-24 Added Unicode support to TabToolTipText. 142 | 2022-11-24 Fixed a bug in FlatBorderMode = ntBorderTabSel. 143 | 2022-11-24 Fixed a bug in RightToLeft and themed. 144 | 2022-11-19 Minor bux fix in pagNewTabThemes property page. 145 | 2022-11-15 removed (actually hided) de IconFont property, since it is source of confusion. It worked like several other tab properties, that work with the current tab (since the font is per tab, like the Caption, the IconCharHex or Picture), but in this case it seems to be a cause of confusion. Better to just leave the access to the TabIconFont property from the Tabs property page. 146 | 2022-11-15 Ole OCX version changed to 2 because binary compatibility was broken. 147 | 2022-11-15 Added two new default themes. 148 | 2022-11-15 Changed HighlightMode and HighlightModeTabSel properties type from an Enum to a Long using flags. Added the FlatDrawBorder flag, and two related color properties: FlatTabBorderColorHighlight and FlatTabBorderColorTabSel. 149 | 2022-11-14 Improvements in tab dragging (changing tab position when CanReorderTabs = True). 150 | 2022-11-12 Added middle click handling to tabs in TDIMode. 151 | 2022-11-10 Initial release. -------------------------------------------------------------------------------- /docs/ReadMe.txt: -------------------------------------------------------------------------------- 1 | Steps for replacing SSTab with NewTab in a project: 2 | 3 | 1 - Make a backup of your original project. 4 | 2 - Open the project in the IDE and from menu Project, Components, select NewTab for VB6, then click OK. 5 | 3 - Save the project and close the IDE. 6 | 4 - Not required but if you open the vbp file with Notepad now you should see this line: 7 | Object={66E63055-5A66-4C79-9327-4BC077858695}#14.0#0; NewTab01.ocx 8 | 5 - Now you need to open with Notepad or other text editor each frm file and replace the text 'TabDlg.SSTab' with 'NewTabCtl.NewTab' 9 | 6 - In Notepad, use Save As and change the Encoding from UTF-8 to ANSI. 10 | 7 - Alternatively to steps 5 and 6, if you have many forms, you can use a program to make a global text replace in all the *.frm files in a folder. You can use TextRep available here: https://no-nonsense-software.com/freeware 11 | 8 - Open the project in the IDE and go to menu Project, Components, and deselect Microsoft Tabbed Dialog Control 6.0, click OK. 12 | 9 - Save the project. 13 | 14 | 15 | Code for the manifest file to make a SxS installation: 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ocx/NewTab01 Register (run as Admin).bat: -------------------------------------------------------------------------------- 1 | RegSvr32.exe "%~dp0NewTab01.ocx" -------------------------------------------------------------------------------- /ocx/NewTab01 Unregister (run as Admin).bat: -------------------------------------------------------------------------------- 1 | RegSvr32.exe "%~dp0NewTab01.ocx" /u -------------------------------------------------------------------------------- /ocx/NewTab01.ocx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/ocx/NewTab01.ocx -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/Form1.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form1 3 | Caption = "Form1" 4 | ClientHeight = 9084 5 | ClientLeft = 2340 6 | ClientTop = 2064 7 | ClientWidth = 5604 8 | BeginProperty Font 9 | Name = "Segoe UI" 10 | Size = 9 11 | Charset = 0 12 | Weight = 400 13 | Underline = 0 'False 14 | Italic = 0 'False 15 | Strikethrough = 0 'False 16 | EndProperty 17 | LinkTopic = "Form1" 18 | ScaleHeight = 9084 19 | ScaleWidth = 5604 20 | Begin VB.PictureBox picContainer 21 | BorderStyle = 0 'None 22 | Height = 5172 23 | Left = 600 24 | ScaleHeight = 5172 25 | ScaleWidth = 3972 26 | TabIndex = 0 27 | Top = 480 28 | Width = 3972 29 | Begin VB.CommandButton Command1 30 | Caption = "Close" 31 | Height = 612 32 | Left = 1200 33 | TabIndex = 4 34 | Top = 4080 35 | Width = 1892 36 | End 37 | Begin VB.PictureBox Picture1 38 | Height = 1212 39 | Left = 1080 40 | ScaleHeight = 1164 41 | ScaleWidth = 2004 42 | TabIndex = 3 43 | Top = 0 44 | Width = 2052 45 | End 46 | Begin VB.ComboBox Combo1 47 | Height = 336 48 | Left = 1320 49 | TabIndex = 2 50 | Text = "Combo1" 51 | Top = 2040 52 | Width = 1452 53 | End 54 | Begin VB.CommandButton Command3 55 | Caption = "Show Form3 modal" 56 | Height = 612 57 | Left = 1200 58 | TabIndex = 1 59 | Top = 3360 60 | Width = 1892 61 | End 62 | End 63 | End 64 | Attribute VB_Name = "Form1" 65 | Attribute VB_GlobalNameSpace = False 66 | Attribute VB_Creatable = False 67 | Attribute VB_PredeclaredId = True 68 | Attribute VB_Exposed = False 69 | Option Explicit 70 | 71 | Private Sub Command1_Click() 72 | Unload Me 73 | End Sub 74 | 75 | Private Sub Command3_Click() 76 | Form3Modal.Show vbModal 77 | End Sub 78 | 79 | Private Sub Form_Resize() 80 | picContainer.Move (Me.ScaleWidth - picContainer.Height) / 2, (Me.ScaleHeight - picContainer.Height) / 2 81 | End Sub 82 | -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/Form2.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form2 3 | Caption = "Form2" 4 | ClientHeight = 9084 5 | ClientLeft = 2340 6 | ClientTop = 2064 7 | ClientWidth = 5604 8 | BeginProperty Font 9 | Name = "Segoe UI" 10 | Size = 9 11 | Charset = 0 12 | Weight = 400 13 | Underline = 0 'False 14 | Italic = 0 'False 15 | Strikethrough = 0 'False 16 | EndProperty 17 | Icon = "Form2.frx":0000 18 | LinkTopic = "Form2" 19 | ScaleHeight = 9084 20 | ScaleWidth = 5604 21 | Begin VB.TextBox Text2 22 | Height = 7212 23 | Left = 240 24 | MultiLine = -1 'True 25 | ScrollBars = 3 'Both 26 | TabIndex = 1 27 | Text = "Form2.frx":030A 28 | Top = 1200 29 | Width = 5052 30 | End 31 | Begin VB.TextBox Text1 32 | Height = 372 33 | Left = 960 34 | TabIndex = 0 35 | Text = "Text1" 36 | Top = 360 37 | Width = 3852 38 | End 39 | Begin VB.Label Label1 40 | Caption = "Find:" 41 | Height = 372 42 | Left = 480 43 | TabIndex = 2 44 | Top = 420 45 | Width = 492 46 | End 47 | End 48 | Attribute VB_Name = "Form2" 49 | Attribute VB_GlobalNameSpace = False 50 | Attribute VB_Creatable = False 51 | Attribute VB_PredeclaredId = True 52 | Attribute VB_Exposed = False 53 | Option Explicit 54 | 55 | Private Sub Form_Resize() 56 | If (Me.WindowState <> vbMinimized) And (Me.ScaleWidth <> 0) Then 57 | Text2.Move 0, Text1.Top + Text1.Height + 200, Me.ScaleWidth, Me.ScaleHeight - Text1.Top - Text1.Height - 200 58 | End If 59 | End Sub 60 | -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/Form2.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/test compiled ocx/TDIForms test/Form2.frx -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/Form3Modal.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form3Modal 3 | BorderStyle = 3 'Fixed Dialog 4 | Caption = "Form3 Modal" 5 | ClientHeight = 3444 6 | ClientLeft = 2340 7 | ClientTop = 2064 8 | ClientWidth = 5148 9 | BeginProperty Font 10 | Name = "Segoe UI" 11 | Size = 9 12 | Charset = 0 13 | Weight = 400 14 | Underline = 0 'False 15 | Italic = 0 'False 16 | Strikethrough = 0 'False 17 | EndProperty 18 | LinkTopic = "Form3" 19 | MaxButton = 0 'False 20 | MinButton = 0 'False 21 | ScaleHeight = 3444 22 | ScaleWidth = 5148 23 | ShowInTaskbar = 0 'False 24 | StartUpPosition = 1 'CenterOwner 25 | Begin VB.CommandButton Command1 26 | Caption = "Close" 27 | Height = 492 28 | Left = 3360 29 | TabIndex = 1 30 | Top = 2640 31 | Width = 1332 32 | End 33 | Begin VB.Label Label1 34 | Caption = "This is a modal form." 35 | Height = 1092 36 | Left = 840 37 | TabIndex = 0 38 | Top = 480 39 | Width = 3132 40 | End 41 | End 42 | Attribute VB_Name = "Form3Modal" 43 | Attribute VB_GlobalNameSpace = False 44 | Attribute VB_Creatable = False 45 | Attribute VB_PredeclaredId = True 46 | Attribute VB_Exposed = False 47 | Option Explicit 48 | 49 | Private Sub Command1_Click() 50 | Unload Me 51 | End Sub 52 | -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/Form4.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form4 3 | Caption = "Form4" 4 | ClientHeight = 5868 5 | ClientLeft = 5640 6 | ClientTop = 3108 7 | ClientWidth = 7344 8 | BeginProperty Font 9 | Name = "Segoe UI" 10 | Size = 9 11 | Charset = 0 12 | Weight = 400 13 | Underline = 0 'False 14 | Italic = 0 'False 15 | Strikethrough = 0 'False 16 | EndProperty 17 | LinkTopic = "Form3" 18 | ScaleHeight = 5868 19 | ScaleWidth = 7344 20 | Begin VB.Label Label2 21 | Caption = $"Form4.frx":0000 22 | Height = 972 23 | Left = 360 24 | TabIndex = 1 25 | Top = 1200 26 | Width = 6732 27 | End 28 | Begin VB.Label Label1 29 | Caption = $"Form4.frx":00A6 30 | Height = 972 31 | Left = 360 32 | TabIndex = 0 33 | Top = 240 34 | Width = 6732 35 | End 36 | End 37 | Attribute VB_Name = "Form4" 38 | Attribute VB_GlobalNameSpace = False 39 | Attribute VB_Creatable = False 40 | Attribute VB_PredeclaredId = True 41 | Attribute VB_Exposed = False 42 | Option Explicit 43 | 44 | -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/Form4.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/test compiled ocx/TDIForms test/Form4.frx -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/TDIFormsTest.vbp: -------------------------------------------------------------------------------- 1 | Type=Exe 2 | Form=frmTDIFormsTest.frm 3 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\SysWow64\stdole2.tlb#OLE Automation 4 | Object={66E63055-5A66-4C79-9327-4BC077858695}#12.0#0; NewTab01.ocx 5 | Form=Form1.frm 6 | Form=Form2.frm 7 | Form=Form3Modal.frm 8 | Form=Form4.frm 9 | IconForm="frmTDIFormsTest" 10 | Startup="frmTDIFormsTest" 11 | HelpFile="" 12 | Title="TDIFormsTest" 13 | Command32="" 14 | Name="TDIFormsTest" 15 | HelpContextID="0" 16 | CompatibleMode="0" 17 | MajorVer=1 18 | MinorVer=0 19 | RevisionVer=0 20 | AutoIncrementVer=0 21 | ServerSupportFiles=0 22 | CompilationType=0 23 | OptimizationType=0 24 | FavorPentiumPro(tm)=0 25 | CodeViewDebugInfo=0 26 | NoAliasing=0 27 | BoundsCheck=0 28 | OverflowCheck=0 29 | FlPointCheck=0 30 | FDIVCheck=0 31 | UnroundedFP=0 32 | StartMode=0 33 | Unattended=0 34 | Retained=0 35 | ThreadPerObject=0 36 | MaxNumberOfThreads=1 37 | -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/frmTDIFormsTest.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Object = "{66E63055-5A66-4C79-9327-4BC077858695}#12.0#0"; "NewTab01.ocx" 3 | Begin VB.Form frmTDIFormsTest 4 | Caption = "TDI forms test" 5 | ClientHeight = 8112 6 | ClientLeft = 4308 7 | ClientTop = 2520 8 | ClientWidth = 13632 9 | BeginProperty Font 10 | Name = "Segoe UI" 11 | Size = 9 12 | Charset = 0 13 | Weight = 400 14 | Underline = 0 'False 15 | Italic = 0 'False 16 | Strikethrough = 0 'False 17 | EndProperty 18 | LinkTopic = "Form1" 19 | ScaleHeight = 8112 20 | ScaleWidth = 13632 21 | Begin NewTabCtl.NewTab NewTab1 22 | Height = 4332 23 | Left = 720 24 | TabIndex = 0 25 | Top = 600 26 | Width = 5892 27 | _ExtentX = 10393 28 | _ExtentY = 7641 29 | ControlJustAdded= 0 'False 30 | Tabs = 1 31 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 32 | Name = "Segoe UI" 33 | Size = 10.2 34 | Charset = 0 35 | Weight = 400 36 | Underline = 0 'False 37 | Italic = 0 'False 38 | Strikethrough = 0 'False 39 | EndProperty 40 | TabHeight = 783 41 | IconAlignment = 5 42 | AutoTabHeight = -1 'True 43 | IconColorMouseHover= 255 44 | IconColorMouseHoverSelectedTab= 255 45 | CanReorderTabs = -1 'True 46 | TDIMode = 2 47 | ControlVersion = 12 48 | TabCaption(0) = "Home" 49 | Tab(0).ControlCount= 6 50 | Tab(0).Control(0)= "Command6" 51 | Tab(0).Control(1)= "Command5" 52 | Tab(0).Control(2)= "Command4" 53 | Tab(0).Control(3)= "Command1" 54 | Tab(0).Control(4)= "Command2" 55 | Tab(0).Control(5)= "Command3" 56 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 57 | Name = "Segoe MDL2 Assets" 58 | Size = 16.2 59 | Charset = 0 60 | Weight = 700 61 | Underline = 0 'False 62 | Italic = 0 'False 63 | Strikethrough = 0 'False 64 | EndProperty 65 | IconFontName(0) = "Segoe MDL2 Assets" 66 | Begin VB.CommandButton Command6 67 | Caption = "Show Form4 (non-TDI-child)" 68 | Height = 612 69 | Left = 600 70 | TabIndex = 7 71 | Top = 3240 72 | Width = 1892 73 | End 74 | Begin VB.CommandButton Command5 75 | Caption = "Close all forms (tabs)" 76 | Height = 612 77 | Left = 2880 78 | TabIndex = 5 79 | Top = 2436 80 | Width = 1892 81 | End 82 | Begin VB.CommandButton Command4 83 | Caption = "Launch new Form2 instance" 84 | Height = 612 85 | Left = 2880 86 | TabIndex = 4 87 | Top = 1596 88 | Width = 1892 89 | End 90 | Begin VB.CommandButton Command1 91 | Caption = "Show Form1" 92 | Height = 612 93 | Left = 600 94 | TabIndex = 3 95 | Top = 756 96 | Width = 1892 97 | End 98 | Begin VB.CommandButton Command2 99 | Caption = "Show Form2 (default Form2)" 100 | Height = 612 101 | Left = 600 102 | TabIndex = 2 103 | Top = 1596 104 | Width = 1892 105 | End 106 | Begin VB.CommandButton Command3 107 | Caption = "Show Form3 modal" 108 | Height = 612 109 | Left = 600 110 | TabIndex = 1 111 | Top = 2436 112 | Width = 1892 113 | End 114 | End 115 | Begin VB.Image Image1 116 | Height = 8028 117 | Left = 6960 118 | Picture = "frmTDIFormsTest.frx":0000 119 | Top = 1680 120 | Visible = 0 'False 121 | Width = 6312 122 | End 123 | Begin VB.Label Label1 124 | Caption = $"frmTDIFormsTest.frx":10213E 125 | Height = 1212 126 | Left = 7200 127 | TabIndex = 6 128 | Top = 600 129 | Visible = 0 'False 130 | Width = 3852 131 | End 132 | End 133 | Attribute VB_Name = "frmTDIFormsTest" 134 | Attribute VB_GlobalNameSpace = False 135 | Attribute VB_Creatable = False 136 | Attribute VB_PredeclaredId = True 137 | Attribute VB_Exposed = False 138 | Option Explicit 139 | 140 | Private Sub Command6_Click() 141 | Form4.Show 142 | End Sub 143 | 144 | Private Sub Form_Load() 145 | NewTab1.TabCaption(0) = "Home, Menu or Start" 146 | End Sub 147 | 148 | Private Sub Form_Resize() 149 | NewTab1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight 150 | End Sub 151 | 152 | Private Sub Command1_Click() 153 | Form1.Show 154 | End Sub 155 | 156 | Private Sub Command2_Click() 157 | Form2.Show 158 | End Sub 159 | 160 | Private Sub Command4_Click() 161 | Dim frm As New Form2 162 | 163 | frm.Show 164 | End Sub 165 | 166 | Private Sub Command3_Click() 167 | Form3Modal.Show vbModal 168 | End Sub 169 | 170 | Private Sub Command5_Click() 171 | Dim frm As Form 172 | 173 | For Each frm In Forms 174 | If Not frm Is Me And Not frm Is Form4 Then 175 | Unload frm 176 | End If 177 | Next 178 | End Sub 179 | 180 | Private Sub NewTab1_TDIBeforeNewTab(ByVal TabType As NewTabCtl.NTTDINewTabTypeConstants, ByVal TabNumber As Long, TabCaption As String, LoadControls As Boolean, ShowTabCloseButton As Boolean, Cancel As Boolean) 181 | If TabCaption = "Form4" Then 182 | Cancel = True 183 | End If 184 | End Sub 185 | 186 | -------------------------------------------------------------------------------- /test compiled ocx/TDIForms test/frmTDIFormsTest.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/test compiled ocx/TDIForms test/frmTDIFormsTest.frx -------------------------------------------------------------------------------- /test compiled ocx/Test.vbp: -------------------------------------------------------------------------------- 1 | Type=Exe 2 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\SysWow64\stdole2.tlb#OLE Automation 3 | Object={66E63055-5A66-4C79-9327-4BC077858695}#12.0#0; NewTab01.ocx 4 | Form=frmTDIControlsTest.frm 5 | Form=frmMain.frm 6 | Form=frmIcons.frm 7 | Form=frmAllThemes.frm 8 | Startup="frmMain" 9 | HelpFile="" 10 | Command32="" 11 | Name="NewTabTest" 12 | HelpContextID="0" 13 | CompatibleMode="0" 14 | MajorVer=1 15 | MinorVer=0 16 | RevisionVer=0 17 | AutoIncrementVer=0 18 | ServerSupportFiles=0 19 | VersionCompanyName="Empresa" 20 | CompilationType=0 21 | OptimizationType=0 22 | FavorPentiumPro(tm)=0 23 | CodeViewDebugInfo=0 24 | NoAliasing=0 25 | BoundsCheck=0 26 | OverflowCheck=0 27 | FlPointCheck=0 28 | FDIVCheck=0 29 | UnroundedFP=0 30 | StartMode=0 31 | Unattended=0 32 | Retained=0 33 | ThreadPerObject=0 34 | MaxNumberOfThreads=1 35 | 36 | [MS Transaction Server] 37 | AutoRefresh=1 38 | -------------------------------------------------------------------------------- /test compiled ocx/frmIcons.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Object = "{66E63055-5A66-4C79-9327-4BC077858695}#3.0#0"; "NewTab01.ocx" 3 | Begin VB.Form frmIcons 4 | BorderStyle = 1 'Fixed Single 5 | Caption = "Icons" 6 | ClientHeight = 9516 7 | ClientLeft = 2844 8 | ClientTop = 1548 9 | ClientWidth = 10128 10 | BeginProperty Font 11 | Name = "Segoe UI" 12 | Size = 9 13 | Charset = 0 14 | Weight = 400 15 | Underline = 0 'False 16 | Italic = 0 'False 17 | Strikethrough = 0 'False 18 | EndProperty 19 | LinkTopic = "Form2" 20 | MaxButton = 0 'False 21 | MinButton = 0 'False 22 | ScaleHeight = 9516 23 | ScaleWidth = 10128 24 | Begin NewTabCtl.NewTab NewTab1 25 | Height = 2052 26 | Left = 360 27 | TabIndex = 0 28 | Top = 240 29 | Width = 4572 30 | _ExtentX = 8065 31 | _ExtentY = 3620 32 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 33 | Name = "Segoe UI" 34 | Size = 9 35 | Charset = 0 36 | Weight = 400 37 | Underline = 0 'False 38 | Italic = 0 'False 39 | Strikethrough = 0 'False 40 | EndProperty 41 | TabHeight = 643 42 | Themed = 0 'False 43 | AutoTabHeight = -1 'True 44 | TabIconChar(0) = 57605 45 | TabCaption(0) = "Tab 0" 46 | Tab(0).ControlCount= 0 47 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 48 | Name = "Segoe MDL2 Assets" 49 | Size = 13.8 50 | Charset = 0 51 | Weight = 400 52 | Underline = 0 'False 53 | Italic = 0 'False 54 | Strikethrough = 0 'False 55 | EndProperty 56 | IconFontName(0) = "Segoe MDL2 Assets" 57 | TabIconChar(1) = 57607 58 | TabCaption(1) = "Tab 1" 59 | Tab(1).ControlCount= 0 60 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 61 | Name = "Segoe MDL2 Assets" 62 | Size = 13.8 63 | Charset = 0 64 | Weight = 400 65 | Underline = 0 'False 66 | Italic = 0 'False 67 | Strikethrough = 0 'False 68 | EndProperty 69 | IconFontName(1) = "Segoe MDL2 Assets" 70 | TabIconChar(2) = 57621 71 | TabCaption(2) = "Tab 2" 72 | Tab(2).ControlCount= 0 73 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 74 | Name = "Segoe MDL2 Assets" 75 | Size = 13.8 76 | Charset = 0 77 | Weight = 400 78 | Underline = 0 'False 79 | Italic = 0 'False 80 | Strikethrough = 0 'False 81 | EndProperty 82 | IconFontName(2) = "Segoe MDL2 Assets" 83 | End 84 | Begin NewTabCtl.NewTab NewTab2 85 | Height = 2052 86 | Left = 360 87 | TabIndex = 2 88 | Top = 2520 89 | Width = 4572 90 | _ExtentX = 8065 91 | _ExtentY = 3620 92 | ForeColorTabSel = 10184001 93 | ForeColorHighlighted= 16777215 94 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 95 | Name = "Segoe UI" 96 | Size = 9 97 | Charset = 0 98 | Weight = 400 99 | Underline = 0 'False 100 | Italic = 0 'False 101 | Strikethrough = 0 'False 102 | EndProperty 103 | Style = 3 104 | TabHeight = 643 105 | Themed = 0 'False 106 | BackColorTabSel = 16250871 107 | FlatTabsSeparationLineColor= -2147483633 108 | FlatBorderColor = 10184001 109 | HighlightColor = 16477710 110 | IconAlignment = 3 111 | AutoTabHeight = -1 'True 112 | FlatRoundnessTabs= 8 113 | TabMousePointerHand= -1 'True 114 | IconColorTabSel = 10184001 115 | IconColorMouseHover= 16777215 116 | IconColorMouseHoverTabSel= 10184001 117 | IconColorTabHighlighted= 16777215 118 | HighlightMode = 4 119 | HighlightModeTabSel= 10 120 | FlatBorderMode = 1 121 | FlatBarHeight = 0 122 | TabIconChar(0) = 57605 123 | TabCaption(0) = "Tab 0" 124 | Tab(0).ControlCount= 0 125 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 126 | Name = "Segoe MDL2 Assets" 127 | Size = 13.8 128 | Charset = 0 129 | Weight = 400 130 | Underline = 0 'False 131 | Italic = 0 'False 132 | Strikethrough = 0 'False 133 | EndProperty 134 | IconFontName(0) = "Segoe MDL2 Assets" 135 | TabIconChar(1) = 57607 136 | TabCaption(1) = "Tab 1" 137 | Tab(1).ControlCount= 0 138 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 139 | Name = "Segoe MDL2 Assets" 140 | Size = 13.8 141 | Charset = 0 142 | Weight = 400 143 | Underline = 0 'False 144 | Italic = 0 'False 145 | Strikethrough = 0 'False 146 | EndProperty 147 | IconFontName(1) = "Segoe MDL2 Assets" 148 | TabIconChar(2) = 57621 149 | TabCaption(2) = "Tab 2" 150 | Tab(2).ControlCount= 0 151 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 152 | Name = "Segoe MDL2 Assets" 153 | Size = 13.8 154 | Charset = 0 155 | Weight = 400 156 | Underline = 0 'False 157 | Italic = 0 'False 158 | Strikethrough = 0 'False 159 | EndProperty 160 | IconFontName(2) = "Segoe MDL2 Assets" 161 | End 162 | Begin NewTabCtl.NewTab NewTab3 163 | Height = 2052 164 | Left = 360 165 | TabIndex = 4 166 | Top = 4800 167 | Width = 4572 168 | _ExtentX = 8065 169 | _ExtentY = 3620 170 | ForeColorTabSel = 16777215 171 | ForeColorHighlighted= 16731706 172 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 173 | Name = "Segoe UI" 174 | Size = 9 175 | Charset = 0 176 | Weight = 400 177 | Underline = 0 'False 178 | Italic = 0 'False 179 | Strikethrough = 0 'False 180 | EndProperty 181 | Style = 3 182 | TabHeight = 1522 183 | Themed = 0 'False 184 | BackColorTabs = 16250871 185 | FlatBarColorHighlight= 16250871 186 | FlatBarColorInactive= 16250871 187 | FlatTabsSeparationLineColor= 16250871 188 | FlatBodySeparationLineColor= 14869218 189 | FlatBorderColor = 16731706 190 | HighlightColor = 16477710 191 | HighlightColorTabSel= 16477710 192 | IconAlignment = 7 193 | AutoTabHeight = -1 'True 194 | FlatBarColorTabSel= 16731706 195 | FlatRoundnessTabs= 8 196 | TabMousePointerHand= -1 'True 197 | IconColorTabSel = 16777215 198 | IconColorMouseHover= 16731706 199 | IconColorMouseHoverTabSel= 16777215 200 | IconColorTabHighlighted= 16731706 201 | HighlightMode = 16 202 | HighlightModeTabSel= 20 203 | FlatBorderMode = 1 204 | FlatBarHeight = 4 205 | FlatBarPosition = 1 206 | TabIconChar(0) = 57615 207 | TabCaption(0) = "Tab 0" 208 | Tab(0).ControlCount= 0 209 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 210 | Name = "Segoe MDL2 Assets" 211 | Size = 24 212 | Charset = 0 213 | Weight = 400 214 | Underline = 0 'False 215 | Italic = 0 'False 216 | Strikethrough = 0 'False 217 | EndProperty 218 | IconFontName(0) = "Segoe MDL2 Assets" 219 | TabIconChar(1) = 57637 220 | TabCaption(1) = "Tab 1" 221 | Tab(1).ControlCount= 0 222 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 223 | Name = "Segoe MDL2 Assets" 224 | Size = 24 225 | Charset = 0 226 | Weight = 400 227 | Underline = 0 'False 228 | Italic = 0 'False 229 | Strikethrough = 0 'False 230 | EndProperty 231 | IconFontName(1) = "Segoe MDL2 Assets" 232 | TabIconChar(2) = 57626 233 | TabCaption(2) = "Tab 2" 234 | Tab(2).ControlCount= 0 235 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 236 | Name = "Segoe MDL2 Assets" 237 | Size = 24 238 | Charset = 0 239 | Weight = 400 240 | Underline = 0 'False 241 | Italic = 0 'False 242 | Strikethrough = 0 'False 243 | EndProperty 244 | IconFontName(2) = "Segoe MDL2 Assets" 245 | End 246 | Begin NewTabCtl.NewTab NewTab5 247 | Height = 2052 248 | Left = 5160 249 | TabIndex = 3 250 | Top = 2520 251 | Width = 4572 252 | _ExtentX = 8065 253 | _ExtentY = 3620 254 | ForeColor = 0 255 | ForeColorTabSel = 16777215 256 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 257 | Name = "Segoe UI" 258 | Size = 9 259 | Charset = 0 260 | Weight = 400 261 | Underline = 0 'False 262 | Italic = 0 'False 263 | Strikethrough = 0 'False 264 | EndProperty 265 | Style = 3 266 | TabHeight = 1522 267 | Themed = 0 'False 268 | BackColorTabSel = 16250871 269 | FlatTabsSeparationLineColor= 11250603 270 | FlatBodySeparationLineColor= 7699508 271 | FlatBorderColor = 7699508 272 | HighlightColor = 12766860 273 | HighlightColorTabSel= 7699508 274 | TabSeparation = 8 275 | IconAlignment = 8 276 | AutoTabHeight = -1 'True 277 | FlatBarColorTabSel= 7699508 278 | FlatRoundnessTabs= 8 279 | TabMousePointerHand= -1 'True 280 | IconColorTabSel = 16777215 281 | IconColorMouseHoverTabSel= 16777215 282 | HighlightMode = 4 283 | HighlightModeTabSel= 20 284 | FlatBorderMode = 1 285 | FlatBarHeight = 0 286 | FlatBodySeparationLineHeight= 3 287 | TabIconChar(0) = 57650 288 | TabCaption(0) = "Tab 0" 289 | Tab(0).ControlCount= 0 290 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 291 | Name = "Segoe MDL2 Assets" 292 | Size = 24 293 | Charset = 0 294 | Weight = 400 295 | Underline = 0 'False 296 | Italic = 0 'False 297 | Strikethrough = 0 'False 298 | EndProperty 299 | IconFontName(0) = "Segoe MDL2 Assets" 300 | TabIconChar(1) = 57637 301 | TabCaption(1) = "Tab 1" 302 | Tab(1).ControlCount= 0 303 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 304 | Name = "Segoe MDL2 Assets" 305 | Size = 24 306 | Charset = 0 307 | Weight = 400 308 | Underline = 0 'False 309 | Italic = 0 'False 310 | Strikethrough = 0 'False 311 | EndProperty 312 | IconFontName(1) = "Segoe MDL2 Assets" 313 | TabIconChar(2) = 57626 314 | TabCaption(2) = "Tab 2" 315 | Tab(2).ControlCount= 0 316 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 317 | Name = "Segoe MDL2 Assets" 318 | Size = 24 319 | Charset = 0 320 | Weight = 400 321 | Underline = 0 'False 322 | Italic = 0 'False 323 | Strikethrough = 0 'False 324 | EndProperty 325 | IconFontName(2) = "Segoe MDL2 Assets" 326 | End 327 | Begin NewTabCtl.NewTab NewTab6 328 | Height = 2052 329 | Left = 5160 330 | TabIndex = 5 331 | Top = 4800 332 | Width = 4572 333 | _ExtentX = 8065 334 | _ExtentY = 3620 335 | Tabs = 4 336 | ForeColor = 16777215 337 | ForeColorTabSel = 0 338 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 339 | Name = "Segoe UI" 340 | Size = 9 341 | Charset = 0 342 | Weight = 400 343 | Underline = 0 'False 344 | Italic = 0 'False 345 | Strikethrough = 0 'False 346 | EndProperty 347 | Style = 3 348 | TabHeight = 1734 349 | Themed = 0 'False 350 | BackColorTabs = 10646340 351 | BackColorTabSel = -2147483633 352 | FlatBarColorHighlight= 4228799 353 | FlatBarColorInactive= 10646340 354 | FlatTabsSeparationLineColor= 7434609 355 | FlatBodySeparationLineColor= 7434609 356 | FlatBorderColor = -2147483633 357 | HighlightColor = 10646340 358 | HighlightColorTabSel= -2147483633 359 | ChangeControlsForeColor= 0 'False 360 | TabSeparation = 8 361 | IconAlignment = 8 362 | AutoTabHeight = -1 'True 363 | FlatBarColorTabSel= 10646340 364 | FlatRoundnessTop= 0 365 | FlatRoundnessBottom= 0 366 | TabMousePointerHand= -1 'True 367 | IconColorTabSel = 0 368 | IconColorMouseHoverTabSel= 0 369 | HighlightMode = 196 370 | HighlightModeTabSel= 196 371 | FlatBarPosition = 1 372 | FlatBodySeparationLineHeight= 0 373 | TabIconChar(0) = 57650 374 | TabCaption(0) = "Tab 0" 375 | Tab(0).ControlCount= 0 376 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 377 | Name = "Segoe MDL2 Assets" 378 | Size = 24 379 | Charset = 0 380 | Weight = 400 381 | Underline = 0 'False 382 | Italic = 0 'False 383 | Strikethrough = 0 'False 384 | EndProperty 385 | IconFontName(0) = "Segoe MDL2 Assets" 386 | TabIconChar(1) = 57746 387 | TabCaption(1) = "Tab 1" 388 | Tab(1).ControlCount= 0 389 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 390 | Name = "Segoe MDL2 Assets" 391 | Size = 24 392 | Charset = 0 393 | Weight = 400 394 | Underline = 0 'False 395 | Italic = 0 'False 396 | Strikethrough = 0 'False 397 | EndProperty 398 | IconFontName(1) = "Segoe MDL2 Assets" 399 | TabIconChar(2) = 57626 400 | TabCaption(2) = "Tab 2" 401 | Tab(2).ControlCount= 0 402 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 403 | Name = "Segoe MDL2 Assets" 404 | Size = 24 405 | Charset = 0 406 | Weight = 400 407 | Underline = 0 'False 408 | Italic = 0 'False 409 | Strikethrough = 0 'False 410 | EndProperty 411 | IconFontName(2) = "Segoe MDL2 Assets" 412 | TabIconChar(3) = 57651 413 | TabCaption(3) = "Tab 3" 414 | Tab(3).ControlCount= 0 415 | BeginProperty IconFont(3) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 416 | Name = "Segoe MDL2 Assets" 417 | Size = 24 418 | Charset = 0 419 | Weight = 400 420 | Underline = 0 'False 421 | Italic = 0 'False 422 | Strikethrough = 0 'False 423 | EndProperty 424 | IconFontName(3) = "Segoe MDL2 Assets" 425 | End 426 | Begin NewTabCtl.NewTab NewTab7 427 | Height = 2052 428 | Left = 360 429 | TabIndex = 6 430 | Top = 7080 431 | Width = 4572 432 | _ExtentX = 8065 433 | _ExtentY = 3620 434 | Tabs = 4 435 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 436 | Name = "Segoe UI" 437 | Size = 9 438 | Charset = 0 439 | Weight = 400 440 | Underline = 0 'False 441 | Italic = 0 'False 442 | Strikethrough = 0 'False 443 | EndProperty 444 | TabOrientation = 1 445 | Style = 3 446 | TabHeight = 1776 447 | Themed = 0 'False 448 | BackColorTabs = 12766860 449 | BackColorTabSel = -2147483633 450 | FlatBarColorHighlight= 7699508 451 | FlatBarColorInactive= 12766860 452 | FlatTabsSeparationLineColor= -2147483633 453 | FlatBodySeparationLineColor= 7699508 454 | FlatBorderColor = 7699508 455 | HighlightColor = 12766860 456 | HighlightColorTabSel= -2147483633 457 | TabSeparation = 8 458 | IconAlignment = 8 459 | AutoTabHeight = -1 'True 460 | FlatBarColorTabSel= 7699508 461 | FlatRoundnessTop= 4 462 | FlatRoundnessBottom= 4 463 | FlatRoundnessTabs= 4 464 | TabMousePointerHand= -1 'True 465 | HighlightMode = 196 466 | HighlightModeTabSel= 196 467 | FlatBorderMode = 1 468 | FlatBarHeight = 5 469 | FlatBarPosition = 1 470 | TabIconChar(0) = 57350 471 | TabCaption(0) = "Tab 0" 472 | Tab(0).ControlCount= 0 473 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 474 | Name = "Segoe MDL2 Assets" 475 | Size = 24 476 | Charset = 0 477 | Weight = 400 478 | Underline = 0 'False 479 | Italic = 0 'False 480 | Strikethrough = 0 'False 481 | EndProperty 482 | IconFontName(0) = "Segoe MDL2 Assets" 483 | TabIconChar(1) = 57637 484 | TabCaption(1) = "Tab 1" 485 | Tab(1).ControlCount= 0 486 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 487 | Name = "Segoe MDL2 Assets" 488 | Size = 24 489 | Charset = 0 490 | Weight = 400 491 | Underline = 0 'False 492 | Italic = 0 'False 493 | Strikethrough = 0 'False 494 | EndProperty 495 | IconFontName(1) = "Segoe MDL2 Assets" 496 | TabIconChar(2) = 57626 497 | TabCaption(2) = "Tab 2" 498 | Tab(2).ControlCount= 0 499 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 500 | Name = "Segoe MDL2 Assets" 501 | Size = 24 502 | Charset = 0 503 | Weight = 400 504 | Underline = 0 'False 505 | Italic = 0 'False 506 | Strikethrough = 0 'False 507 | EndProperty 508 | IconFontName(2) = "Segoe MDL2 Assets" 509 | TabIconChar(3) = 59265 510 | TabCaption(3) = "Tab 3" 511 | Tab(3).ControlCount= 0 512 | BeginProperty IconFont(3) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 513 | Name = "Segoe MDL2 Assets" 514 | Size = 24 515 | Charset = 0 516 | Weight = 400 517 | Underline = 0 'False 518 | Italic = 0 'False 519 | Strikethrough = 0 'False 520 | EndProperty 521 | IconFontName(3) = "Segoe MDL2 Assets" 522 | End 523 | Begin NewTabCtl.NewTab NewTab8 524 | Height = 2052 525 | Left = 5160 526 | TabIndex = 7 527 | Top = 7080 528 | Width = 4572 529 | _ExtentX = 8065 530 | _ExtentY = 3620 531 | ForeColorTabSel = 10184001 532 | ForeColorHighlighted= 16777215 533 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 534 | Name = "Segoe UI" 535 | Size = 9 536 | Charset = 0 537 | Weight = 400 538 | Underline = 0 'False 539 | Italic = 0 'False 540 | Strikethrough = 0 'False 541 | EndProperty 542 | TabOrientation = 1 543 | Style = 3 544 | TabHeight = 1522 545 | Themed = 0 'False 546 | BackColorTabSel = 16250871 547 | FlatTabsSeparationLineColor= -2147483633 548 | FlatBorderColor = 10184001 549 | HighlightColor = 16477710 550 | IconAlignment = 8 551 | AutoTabHeight = -1 'True 552 | FlatRoundnessTabs= 8 553 | TabMousePointerHand= -1 'True 554 | IconColorTabSel = 10184001 555 | IconColorMouseHover= 16777215 556 | IconColorMouseHoverTabSel= 10184001 557 | IconColorTabHighlighted= 16777215 558 | HighlightMode = 4 559 | HighlightModeTabSel= 10 560 | FlatBorderMode = 1 561 | FlatBarHeight = 0 562 | TabIconChar(0) = 57350 563 | TabCaption(0) = "Tab 0" 564 | Tab(0).ControlCount= 0 565 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 566 | Name = "Segoe MDL2 Assets" 567 | Size = 24 568 | Charset = 0 569 | Weight = 400 570 | Underline = 0 'False 571 | Italic = 0 'False 572 | Strikethrough = 0 'False 573 | EndProperty 574 | IconFontName(0) = "Segoe MDL2 Assets" 575 | TabIconChar(1) = 57637 576 | TabCaption(1) = "Tab 1" 577 | Tab(1).ControlCount= 0 578 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 579 | Name = "Segoe MDL2 Assets" 580 | Size = 24 581 | Charset = 0 582 | Weight = 400 583 | Underline = 0 'False 584 | Italic = 0 'False 585 | Strikethrough = 0 'False 586 | EndProperty 587 | IconFontName(1) = "Segoe MDL2 Assets" 588 | TabIconChar(2) = 57626 589 | TabCaption(2) = "Tab 2" 590 | Tab(2).ControlCount= 0 591 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 592 | Name = "Segoe MDL2 Assets" 593 | Size = 24 594 | Charset = 0 595 | Weight = 400 596 | Underline = 0 'False 597 | Italic = 0 'False 598 | Strikethrough = 0 'False 599 | EndProperty 600 | IconFontName(2) = "Segoe MDL2 Assets" 601 | End 602 | Begin NewTabCtl.NewTab NewTab4 603 | Height = 2052 604 | Left = 5160 605 | TabIndex = 1 606 | Top = 240 607 | Width = 4572 608 | _ExtentX = 8065 609 | _ExtentY = 3620 610 | Tabs = 5 611 | ForeColorTabSel = 16731706 612 | ForeColorHighlighted= 16731706 613 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 614 | Name = "Segoe UI" 615 | Size = 9 616 | Charset = 0 617 | Weight = 400 618 | Underline = 0 'False 619 | Italic = 0 'False 620 | Strikethrough = 0 'False 621 | EndProperty 622 | Style = 3 623 | TabHeight = 1235 624 | Themed = 0 'False 625 | BackColorTabs = 16250871 626 | FlatBarColorHighlight= 16250871 627 | FlatBarColorInactive= 16250871 628 | FlatTabsSeparationLineColor= 16250871 629 | FlatBodySeparationLineColor= 14869218 630 | FlatBorderColor = 16250871 631 | HighlightColor = 16477710 632 | IconAlignment = 6 633 | FlatBarColorTabSel= 16731706 634 | FlatRoundnessTop= 0 635 | FlatRoundnessBottom= 0 636 | TabMousePointerHand= -1 'True 637 | IconColorTabSel = 16731706 638 | IconColorMouseHover= 16731706 639 | IconColorMouseHoverTabSel= 16731706 640 | IconColorTabHighlighted= 16731706 641 | HighlightMode = 1 642 | HighlightModeTabSel= 1 643 | FlatBarHeight = 4 644 | FlatBarPosition = 1 645 | TabIconChar(0) = 57699 646 | Tab(0).ControlCount= 0 647 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 648 | Name = "Segoe MDL2 Assets" 649 | Size = 24 650 | Charset = 0 651 | Weight = 400 652 | Underline = 0 'False 653 | Italic = 0 'False 654 | Strikethrough = 0 'False 655 | EndProperty 656 | IconFontName(0) = "Segoe MDL2 Assets" 657 | TabIconChar(1) = 57637 658 | Tab(1).ControlCount= 0 659 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 660 | Name = "Segoe MDL2 Assets" 661 | Size = 24 662 | Charset = 0 663 | Weight = 400 664 | Underline = 0 'False 665 | Italic = 0 'False 666 | Strikethrough = 0 'False 667 | EndProperty 668 | IconFontName(1) = "Segoe MDL2 Assets" 669 | TabIconChar(2) = 57626 670 | Tab(2).ControlCount= 0 671 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 672 | Name = "Segoe MDL2 Assets" 673 | Size = 24 674 | Charset = 0 675 | Weight = 400 676 | Underline = 0 'False 677 | Italic = 0 'False 678 | Strikethrough = 0 'False 679 | EndProperty 680 | IconFontName(2) = "Segoe MDL2 Assets" 681 | TabIconChar(3) = 57604 682 | Tab(3).ControlCount= 0 683 | BeginProperty IconFont(3) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 684 | Name = "Segoe MDL2 Assets" 685 | Size = 24 686 | Charset = 0 687 | Weight = 400 688 | Underline = 0 'False 689 | Italic = 0 'False 690 | Strikethrough = 0 'False 691 | EndProperty 692 | IconFontName(3) = "Segoe MDL2 Assets" 693 | TabIconChar(4) = 57615 694 | Tab(4).ControlCount= 0 695 | BeginProperty IconFont(4) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 696 | Name = "Segoe MDL2 Assets" 697 | Size = 24 698 | Charset = 0 699 | Weight = 400 700 | Underline = 0 'False 701 | Italic = 0 'False 702 | Strikethrough = 0 'False 703 | EndProperty 704 | IconFontName(4) = "Segoe MDL2 Assets" 705 | End 706 | End 707 | Attribute VB_Name = "frmIcons" 708 | Attribute VB_GlobalNameSpace = False 709 | Attribute VB_Creatable = False 710 | Attribute VB_PredeclaredId = True 711 | Attribute VB_Exposed = False 712 | Option Explicit 713 | 714 | -------------------------------------------------------------------------------- /test compiled ocx/frmMain.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Object = "{66E63055-5A66-4C79-9327-4BC077858695}#8.0#0"; "NewTab01.ocx" 3 | Begin VB.Form frmMain 4 | BorderStyle = 1 'Fixed Single 5 | Caption = "NewTab sample" 6 | ClientHeight = 5040 7 | ClientLeft = 1524 8 | ClientTop = 1932 9 | ClientWidth = 5844 10 | BeginProperty Font 11 | Name = "Tahoma" 12 | Size = 9 13 | Charset = 0 14 | Weight = 400 15 | Underline = 0 'False 16 | Italic = 0 'False 17 | Strikethrough = 0 'False 18 | EndProperty 19 | LinkTopic = "Form1" 20 | MaxButton = 0 'False 21 | MinButton = 0 'False 22 | ScaleHeight = 5040 23 | ScaleWidth = 5844 24 | Begin VB.CommandButton Command3 25 | Caption = "All current preset themes at once" 26 | Height = 370 27 | Left = 360 28 | TabIndex = 5 29 | Top = 4560 30 | Width = 5130 31 | End 32 | Begin VB.CommandButton Command2 33 | Caption = "Check some tabs with fonts icons" 34 | Height = 370 35 | Left = 360 36 | TabIndex = 4 37 | Top = 4080 38 | Width = 5130 39 | End 40 | Begin VB.CommandButton Command1 41 | Caption = "Test TDI Controls mode (TDI: Tabbed Document Interface)" 42 | Height = 370 43 | Left = 360 44 | TabIndex = 3 45 | Top = 3600 46 | Width = 5130 47 | End 48 | Begin VB.ComboBox cboThemes 49 | Height = 312 50 | Left = 1050 51 | Style = 2 'Dropdown List 52 | TabIndex = 1 53 | Top = 120 54 | Width = 4440 55 | End 56 | Begin NewTabCtl.NewTab NewTab1 57 | Height = 2530 58 | Left = 360 59 | TabIndex = 2 60 | Top = 720 61 | Width = 5130 62 | _ExtentX = 9059 63 | _ExtentY = 4466 64 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 65 | Name = "Tahoma" 66 | Size = 9 67 | Charset = 0 68 | Weight = 400 69 | Underline = 0 'False 70 | Italic = 0 'False 71 | Strikethrough = 0 'False 72 | EndProperty 73 | TabHeight = 600 74 | Themed = 0 'False 75 | AutoTabHeight = -1 'True 76 | TabCaption(0) = "Tab 0" 77 | Tab(0).ControlCount= 0 78 | TabCaption(1) = "Tab 1" 79 | Tab(1).ControlCount= 0 80 | TabCaption(2) = "Tab 2" 81 | Tab(2).ControlCount= 0 82 | End 83 | Begin VB.Label Label1 84 | Caption = "Theme:" 85 | Height = 250 86 | Left = 360 87 | TabIndex = 0 88 | Top = 150 89 | Width = 730 90 | End 91 | End 92 | Attribute VB_Name = "frmMain" 93 | Attribute VB_GlobalNameSpace = False 94 | Attribute VB_Creatable = False 95 | Attribute VB_PredeclaredId = True 96 | Attribute VB_Exposed = False 97 | Option Explicit 98 | 99 | Private Sub cboThemes_Click() 100 | NewTab1.Theme = cboThemes.Text 101 | End Sub 102 | 103 | Private Sub Command1_Click() 104 | frmTDIControlsTest.Show vbModal 105 | End Sub 106 | 107 | Private Sub Command2_Click() 108 | frmIcons.Show vbModal 109 | End Sub 110 | 111 | Private Sub Command3_Click() 112 | frmAllThemes.Show vbModal 113 | End Sub 114 | 115 | Private Sub Form_Load() 116 | Dim iTheme As NewTabTheme 117 | 118 | For Each iTheme In NewTab1.Themes 119 | cboThemes.AddItem iTheme.Name 120 | Next 121 | cboThemes.ListIndex = 0 122 | End Sub 123 | -------------------------------------------------------------------------------- /test compiled ocx/frmTDIControlsTest.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Object = "{66E63055-5A66-4C79-9327-4BC077858695}#11.0#0"; "NewTab01.ocx" 3 | Begin VB.Form frmTDIControlsTest 4 | Caption = "TDI" 5 | ClientHeight = 5748 6 | ClientLeft = 2964 7 | ClientTop = 2568 8 | ClientWidth = 7680 9 | BeginProperty Font 10 | Name = "Tahoma" 11 | Size = 9 12 | Charset = 0 13 | Weight = 400 14 | Underline = 0 'False 15 | Italic = 0 'False 16 | Strikethrough = 0 'False 17 | EndProperty 18 | LinkTopic = "Form2" 19 | ScaleHeight = 5748 20 | ScaleWidth = 7680 21 | StartUpPosition = 2 'CenterScreen 22 | Begin NewTabCtl.NewTab NewTab1 23 | Height = 2530 24 | Left = 0 25 | TabIndex = 0 26 | Top = 0 27 | Width = 5290 28 | _ExtentX = 9335 29 | _ExtentY = 4466 30 | ControlJustAdded= 0 'False 31 | Tabs = 2 32 | ForeColorSelectedTab= 10184001 33 | ForeColorHighlighted= 16777215 34 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 35 | Name = "Tahoma" 36 | Size = 9 37 | Charset = 0 38 | Weight = 400 39 | Underline = 0 'False 40 | Italic = 0 'False 41 | Strikethrough = 0 'False 42 | EndProperty 43 | Style = 3 44 | TabHeight = 631 45 | BackColorSelectedTab= 16250871 46 | FlatBarColorInactive= 14211288 47 | FlatBorderColor = 10184001 48 | HighlightColor = 16477710 49 | IconAlignment = 5 50 | AutoTabHeight = -1 'True 51 | FlatRoundnessTabs= 8 52 | TabMousePointerHand= -1 'True 53 | IconColorMouseHover= 255 54 | IconColorMouseHoverSelectedTab= 255 55 | IconColorTabHighlighted= 16777215 56 | HighlightMode = 12 57 | HighlightModeSelectedTab= 10 58 | FlatBorderMode = 1 59 | FlatBarHeight = 0 60 | CanReorderTabs = -1 'True 61 | TDIMode = 1 62 | ControlVersion = 11 63 | TabIconChar(0) = 57606 64 | TabIconLeftOffset(0)= -3 65 | TabIconTopOffset(0)= 1 66 | TabCaption(0) = "New tab template " 67 | Tab(0).ControlCount= 4 68 | Tab(0).Control(0)= "txtDoc(0)" 69 | Tab(0).Control(1)= "Command1(0)" 70 | Tab(0).Control(2)= "txtSearch(0)" 71 | Tab(0).Control(3)= "Label1(0)" 72 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 73 | Name = "Segoe MDL2 Assets" 74 | Size = 10.2 75 | Charset = 0 76 | Weight = 700 77 | Underline = 0 'False 78 | Italic = 0 'False 79 | Strikethrough = 0 'False 80 | EndProperty 81 | IconFontName(0) = "Segoe MDL2 Assets" 82 | TabIconChar(1) = 63658 83 | TabIconLeftOffset(1)= -2 84 | TabIconTopOffset(1)= 1 85 | TabCaption(1) = "" 86 | TabToolTipText(1)= "Add a new tab" 87 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 88 | Name = "Segoe MDL2 Assets" 89 | Size = 13.8 90 | Charset = 0 91 | Weight = 700 92 | Underline = 0 'False 93 | Italic = 0 'False 94 | Strikethrough = 0 'False 95 | EndProperty 96 | IconFontName(1) = "Segoe MDL2 Assets" 97 | Begin VB.TextBox txtDoc 98 | Appearance = 0 'Flat 99 | Height = 1210 100 | Index = 0 101 | Left = 120 102 | MultiLine = -1 'True 103 | TabIndex = 4 104 | Top = 1140 105 | Width = 5050 106 | End 107 | Begin VB.CommandButton Command1 108 | BackColor = &H00F7F7F7& 109 | Caption = "Do search" 110 | Height = 370 111 | Index = 0 112 | Left = 3840 113 | TabIndex = 3 114 | Top = 540 115 | Width = 1330 116 | End 117 | Begin VB.TextBox txtSearch 118 | Appearance = 0 'Flat 119 | Height = 370 120 | Index = 0 121 | Left = 1320 122 | TabIndex = 2 123 | Top = 540 124 | Width = 2410 125 | End 126 | Begin VB.Label Label1 127 | Alignment = 1 'Right Justify 128 | BackColor = &H00F7F7F7& 129 | Caption = "Find:" 130 | ForeColor = &H009B6541& 131 | Height = 370 132 | Index = 0 133 | Left = 240 134 | TabIndex = 1 135 | Top = 590 136 | Width = 970 137 | End 138 | End 139 | Begin VB.Label Label2 140 | Caption = "TDI: Tabbed Document Interface. To use the TDI Mode 'Controls', set the TDIMode property to 'ntTDIModeControls'." 141 | Height = 972 142 | Left = 600 143 | TabIndex = 5 144 | Top = 3000 145 | Visible = 0 'False 146 | Width = 4452 147 | End 148 | End 149 | Attribute VB_Name = "frmTDIControlsTest" 150 | Attribute VB_GlobalNameSpace = False 151 | Attribute VB_Creatable = False 152 | Attribute VB_PredeclaredId = True 153 | Attribute VB_Exposed = False 154 | Option Explicit 155 | 156 | Private Sub Command1_Click(Index As Integer) 157 | If txtSearch(Index).Text = "" Then 158 | MsgBox "Search what? Please enter something to find!", vbExclamation 159 | txtSearch(Index).SetFocus 160 | Else 161 | txtDoc(Index).Text = txtDoc(Index).Text & "Searched for """ & txtSearch(Index).Text & """." & vbCrLf 162 | txtSearch(Index).Text = "" 163 | End If 164 | End Sub 165 | 166 | Private Sub Form_Resize() 167 | Dim c As Long 168 | 169 | NewTab1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight 170 | 171 | For c = 0 To NewTab1.Tabs - 2 172 | If NewTab1.TabVisible(c) Then 173 | PositionAndResizeControlsInTab c 174 | End If 175 | Next 176 | End Sub 177 | 178 | Private Sub NewTab1_TDINewTabAdded(ByVal TabNumber As Long) 179 | PositionAndResizeControlsInTab TabNumber 180 | End Sub 181 | 182 | Private Sub PositionAndResizeControlsInTab(TabNumber As Long) 183 | NewTab1.ControlMove "txtDoc(" & TabNumber & ")", Screen.TwipsPerPixelX, NewTab1.ClientTop + 700, NewTab1.ClientWidth, NewTab1.ClientHeight - 700 - Screen.TwipsPerPixelY 184 | End Sub 185 | 186 | -------------------------------------------------------------------------------- /test in source code/TDIForms test/Form1.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form1 3 | Caption = "Form1" 4 | ClientHeight = 9084 5 | ClientLeft = 2340 6 | ClientTop = 2064 7 | ClientWidth = 5604 8 | BeginProperty Font 9 | Name = "Segoe UI" 10 | Size = 9 11 | Charset = 0 12 | Weight = 400 13 | Underline = 0 'False 14 | Italic = 0 'False 15 | Strikethrough = 0 'False 16 | EndProperty 17 | LinkTopic = "Form1" 18 | ScaleHeight = 9084 19 | ScaleWidth = 5604 20 | Begin VB.PictureBox picContainer 21 | BorderStyle = 0 'None 22 | Height = 5172 23 | Left = 600 24 | ScaleHeight = 5172 25 | ScaleWidth = 3972 26 | TabIndex = 0 27 | Top = 480 28 | Width = 3972 29 | Begin VB.CommandButton Command1 30 | Caption = "Close" 31 | Height = 612 32 | Left = 1200 33 | TabIndex = 4 34 | Top = 4080 35 | Width = 1892 36 | End 37 | Begin VB.PictureBox Picture1 38 | Height = 1212 39 | Left = 1080 40 | ScaleHeight = 1164 41 | ScaleWidth = 2004 42 | TabIndex = 3 43 | Top = 0 44 | Width = 2052 45 | End 46 | Begin VB.ComboBox Combo1 47 | Height = 336 48 | Left = 1320 49 | TabIndex = 2 50 | Text = "Combo1" 51 | Top = 2040 52 | Width = 1452 53 | End 54 | Begin VB.CommandButton Command3 55 | Caption = "Show Form3 modal" 56 | Height = 612 57 | Left = 1200 58 | TabIndex = 1 59 | Top = 3360 60 | Width = 1892 61 | End 62 | End 63 | End 64 | Attribute VB_Name = "Form1" 65 | Attribute VB_GlobalNameSpace = False 66 | Attribute VB_Creatable = False 67 | Attribute VB_PredeclaredId = True 68 | Attribute VB_Exposed = False 69 | Option Explicit 70 | 71 | Private Sub Command1_Click() 72 | Unload Me 73 | End Sub 74 | 75 | Private Sub Command3_Click() 76 | Form3Modal.Show vbModal 77 | End Sub 78 | 79 | Private Sub Form_Resize() 80 | picContainer.Move (Me.ScaleWidth - picContainer.Height) / 2, (Me.ScaleHeight - picContainer.Height) / 2 81 | If picContainer.Top < 100 Then picContainer.Top = 100 82 | If picContainer.Left < 0 Then picContainer.Left = 0 83 | End Sub 84 | -------------------------------------------------------------------------------- /test in source code/TDIForms test/Form2.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form2 3 | Caption = "Form2" 4 | ClientHeight = 9084 5 | ClientLeft = 2340 6 | ClientTop = 2064 7 | ClientWidth = 5604 8 | BeginProperty Font 9 | Name = "Segoe UI" 10 | Size = 9 11 | Charset = 0 12 | Weight = 400 13 | Underline = 0 'False 14 | Italic = 0 'False 15 | Strikethrough = 0 'False 16 | EndProperty 17 | Icon = "Form2.frx":0000 18 | LinkTopic = "Form2" 19 | ScaleHeight = 9084 20 | ScaleWidth = 5604 21 | Begin VB.TextBox Text2 22 | Height = 7212 23 | Left = 240 24 | MultiLine = -1 'True 25 | ScrollBars = 3 'Both 26 | TabIndex = 1 27 | Text = "Form2.frx":030A 28 | Top = 1200 29 | Width = 5052 30 | End 31 | Begin VB.TextBox Text1 32 | Height = 372 33 | Left = 960 34 | TabIndex = 0 35 | Text = "Text1" 36 | Top = 360 37 | Width = 3852 38 | End 39 | Begin VB.Label Label1 40 | Caption = "Find:" 41 | Height = 372 42 | Left = 480 43 | TabIndex = 2 44 | Top = 420 45 | Width = 492 46 | End 47 | End 48 | Attribute VB_Name = "Form2" 49 | Attribute VB_GlobalNameSpace = False 50 | Attribute VB_Creatable = False 51 | Attribute VB_PredeclaredId = True 52 | Attribute VB_Exposed = False 53 | Option Explicit 54 | 55 | Private Sub Form_Resize() 56 | If (Me.WindowState <> vbMinimized) And (Me.ScaleWidth <> 0) Then 57 | Text2.Move 0, Text1.Top + Text1.Height + 200, Me.ScaleWidth, Me.ScaleHeight - Text1.Top - Text1.Height - 200 58 | End If 59 | End Sub 60 | -------------------------------------------------------------------------------- /test in source code/TDIForms test/Form2.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/test in source code/TDIForms test/Form2.frx -------------------------------------------------------------------------------- /test in source code/TDIForms test/Form3Modal.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form3Modal 3 | BorderStyle = 3 'Fixed Dialog 4 | Caption = "Form3 Modal" 5 | ClientHeight = 3444 6 | ClientLeft = 2340 7 | ClientTop = 2064 8 | ClientWidth = 5148 9 | BeginProperty Font 10 | Name = "Segoe UI" 11 | Size = 9 12 | Charset = 0 13 | Weight = 400 14 | Underline = 0 'False 15 | Italic = 0 'False 16 | Strikethrough = 0 'False 17 | EndProperty 18 | LinkTopic = "Form3" 19 | MaxButton = 0 'False 20 | MinButton = 0 'False 21 | ScaleHeight = 3444 22 | ScaleWidth = 5148 23 | ShowInTaskbar = 0 'False 24 | StartUpPosition = 1 'CenterOwner 25 | Begin VB.CommandButton Command1 26 | Caption = "Close" 27 | Height = 492 28 | Left = 3360 29 | TabIndex = 1 30 | Top = 2640 31 | Width = 1332 32 | End 33 | Begin VB.Label Label1 34 | Caption = "This is a modal form." 35 | Height = 1092 36 | Left = 840 37 | TabIndex = 0 38 | Top = 480 39 | Width = 3132 40 | End 41 | End 42 | Attribute VB_Name = "Form3Modal" 43 | Attribute VB_GlobalNameSpace = False 44 | Attribute VB_Creatable = False 45 | Attribute VB_PredeclaredId = True 46 | Attribute VB_Exposed = False 47 | Option Explicit 48 | 49 | Private Sub Command1_Click() 50 | Unload Me 51 | End Sub 52 | -------------------------------------------------------------------------------- /test in source code/TDIForms test/Form4.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form4 3 | Caption = "Form4" 4 | ClientHeight = 5868 5 | ClientLeft = 5640 6 | ClientTop = 3108 7 | ClientWidth = 7344 8 | BeginProperty Font 9 | Name = "Segoe UI" 10 | Size = 9 11 | Charset = 0 12 | Weight = 400 13 | Underline = 0 'False 14 | Italic = 0 'False 15 | Strikethrough = 0 'False 16 | EndProperty 17 | LinkTopic = "Form3" 18 | ScaleHeight = 5868 19 | ScaleWidth = 7344 20 | Begin VB.Label Label2 21 | Caption = $"Form4.frx":0000 22 | Height = 972 23 | Left = 360 24 | TabIndex = 1 25 | Top = 1200 26 | Width = 6732 27 | End 28 | Begin VB.Label Label1 29 | Caption = $"Form4.frx":00A6 30 | Height = 972 31 | Left = 360 32 | TabIndex = 0 33 | Top = 240 34 | Width = 6732 35 | End 36 | End 37 | Attribute VB_Name = "Form4" 38 | Attribute VB_GlobalNameSpace = False 39 | Attribute VB_Creatable = False 40 | Attribute VB_PredeclaredId = True 41 | Attribute VB_Exposed = False 42 | Option Explicit 43 | 44 | -------------------------------------------------------------------------------- /test in source code/TDIForms test/Form4.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/test in source code/TDIForms test/Form4.frx -------------------------------------------------------------------------------- /test in source code/TDIForms test/TDIFormsTest.vbp: -------------------------------------------------------------------------------- 1 | Type=Exe 2 | Form=frmTDIFormsTest.frm 3 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\SysWow64\stdole2.tlb#OLE Automation 4 | Object=*\A..\..\control-source\NewTabCtl.vbp 5 | Form=Form1.frm 6 | Form=Form2.frm 7 | Form=Form3Modal.frm 8 | Form=Form4.frm 9 | IconForm="frmTDIFormsTest" 10 | Startup="frmTDIFormsTest" 11 | HelpFile="" 12 | Title="TDIFormsTest" 13 | Command32="" 14 | Name="TDIFormsTest" 15 | HelpContextID="0" 16 | CompatibleMode="0" 17 | MajorVer=1 18 | MinorVer=0 19 | RevisionVer=0 20 | AutoIncrementVer=0 21 | ServerSupportFiles=0 22 | CompilationType=0 23 | OptimizationType=0 24 | FavorPentiumPro(tm)=0 25 | CodeViewDebugInfo=0 26 | NoAliasing=0 27 | BoundsCheck=0 28 | OverflowCheck=0 29 | FlPointCheck=0 30 | FDIVCheck=0 31 | UnroundedFP=0 32 | StartMode=0 33 | Unattended=0 34 | Retained=0 35 | ThreadPerObject=0 36 | MaxNumberOfThreads=1 37 | -------------------------------------------------------------------------------- /test in source code/TDIForms test/frmTDIFormsTest.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Object = "*\A..\..\control-source\NewTabCtl.vbp" 3 | Begin VB.Form frmTDIFormsTest 4 | Caption = "TDI forms test" 5 | ClientHeight = 8112 6 | ClientLeft = 4308 7 | ClientTop = 2520 8 | ClientWidth = 13632 9 | BeginProperty Font 10 | Name = "Segoe UI" 11 | Size = 9 12 | Charset = 0 13 | Weight = 400 14 | Underline = 0 'False 15 | Italic = 0 'False 16 | Strikethrough = 0 'False 17 | EndProperty 18 | LinkTopic = "Form1" 19 | ScaleHeight = 8112 20 | ScaleWidth = 13632 21 | Begin NewTabCtl.NewTab NewTab1 22 | Height = 4332 23 | Left = 720 24 | TabIndex = 0 25 | Top = 600 26 | Width = 5892 27 | _ExtentX = 10393 28 | _ExtentY = 7641 29 | ControlJustAdded= 0 'False 30 | Tabs = 1 31 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 32 | Name = "Segoe UI" 33 | Size = 10.2 34 | Charset = 0 35 | Weight = 400 36 | Underline = 0 'False 37 | Italic = 0 'False 38 | Strikethrough = 0 'False 39 | EndProperty 40 | TabHeight = 783 41 | IconAlignment = 5 42 | AutoTabHeight = -1 'True 43 | IconColorMouseHover= 255 44 | IconColorMouseHoverSelectedTab= 255 45 | CanReorderTabs = -1 'True 46 | TDIMode = 2 47 | ControlVersion = 12 48 | TabCaption(0) = "Home" 49 | Tab(0).ControlCount= 6 50 | Tab(0).Control(0)= "Command6" 51 | Tab(0).Control(1)= "Command5" 52 | Tab(0).Control(2)= "Command4" 53 | Tab(0).Control(3)= "Command1" 54 | Tab(0).Control(4)= "Command2" 55 | Tab(0).Control(5)= "Command3" 56 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 57 | Name = "Segoe MDL2 Assets" 58 | Size = 16.2 59 | Charset = 0 60 | Weight = 700 61 | Underline = 0 'False 62 | Italic = 0 'False 63 | Strikethrough = 0 'False 64 | EndProperty 65 | IconFontName(0) = "Segoe MDL2 Assets" 66 | Begin VB.CommandButton Command6 67 | Caption = "Show Form4 (non-TDI-child)" 68 | Height = 612 69 | Left = 600 70 | TabIndex = 7 71 | Top = 3240 72 | Width = 1892 73 | End 74 | Begin VB.CommandButton Command5 75 | Caption = "Close all forms (tabs)" 76 | Height = 612 77 | Left = 2880 78 | TabIndex = 5 79 | Top = 2436 80 | Width = 1892 81 | End 82 | Begin VB.CommandButton Command4 83 | Caption = "Launch new Form2 instance" 84 | Height = 612 85 | Left = 2880 86 | TabIndex = 4 87 | Top = 1596 88 | Width = 1892 89 | End 90 | Begin VB.CommandButton Command1 91 | Caption = "Show Form1" 92 | Height = 612 93 | Left = 600 94 | TabIndex = 3 95 | Top = 756 96 | Width = 1892 97 | End 98 | Begin VB.CommandButton Command2 99 | Caption = "Show Form2 (default Form2)" 100 | Height = 612 101 | Left = 600 102 | TabIndex = 2 103 | Top = 1596 104 | Width = 1892 105 | End 106 | Begin VB.CommandButton Command3 107 | Caption = "Show Form3 modal" 108 | Height = 612 109 | Left = 600 110 | TabIndex = 1 111 | Top = 2436 112 | Width = 1892 113 | End 114 | End 115 | Begin VB.Image Image1 116 | Height = 8028 117 | Left = 6960 118 | Picture = "frmTDIFormsTest.frx":0000 119 | Top = 1680 120 | Visible = 0 'False 121 | Width = 6312 122 | End 123 | Begin VB.Label Label1 124 | Caption = $"frmTDIFormsTest.frx":10213E 125 | Height = 1212 126 | Left = 7200 127 | TabIndex = 6 128 | Top = 600 129 | Visible = 0 'False 130 | Width = 3852 131 | End 132 | End 133 | Attribute VB_Name = "frmTDIFormsTest" 134 | Attribute VB_GlobalNameSpace = False 135 | Attribute VB_Creatable = False 136 | Attribute VB_PredeclaredId = True 137 | Attribute VB_Exposed = False 138 | Option Explicit 139 | 140 | Private Sub Command6_Click() 141 | Form4.Show 142 | End Sub 143 | 144 | Private Sub Form_Load() 145 | NewTab1.TabCaption(0) = "Home, Menu or Start" 146 | End Sub 147 | 148 | Private Sub Form_Resize() 149 | NewTab1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight 150 | End Sub 151 | 152 | Private Sub Command1_Click() 153 | Form1.Show 154 | End Sub 155 | 156 | Private Sub Command2_Click() 157 | Form2.Show 158 | End Sub 159 | 160 | Private Sub Command4_Click() 161 | Dim frm As New Form2 162 | 163 | frm.Show 164 | End Sub 165 | 166 | Private Sub Command3_Click() 167 | Form3Modal.Show vbModal 168 | End Sub 169 | 170 | Private Sub Command5_Click() 171 | Dim frm As Form 172 | 173 | For Each frm In Forms 174 | If Not frm Is Me And Not frm Is Form4 Then 175 | Unload frm 176 | End If 177 | Next 178 | End Sub 179 | 180 | Private Sub NewTab1_TDIBeforeNewTab(ByVal TabType As NewTabCtl.NTTDINewTabTypeConstants, ByVal TabNumber As Long, TabCaption As String, LoadControls As Boolean, ShowTabCloseButton As Boolean, Cancel As Boolean) 181 | If TabCaption = "Form4" Then 182 | Cancel = True 183 | End If 184 | End Sub 185 | -------------------------------------------------------------------------------- /test in source code/TDIForms test/frmTDIFormsTest.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EduardoVB/NewTab/0fefaa63de5ab5bccd8233df79624842987da1e4/test in source code/TDIForms test/frmTDIFormsTest.frx -------------------------------------------------------------------------------- /test in source code/Test.vbp: -------------------------------------------------------------------------------- 1 | Type=Exe 2 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\SysWow64\stdole2.tlb#OLE Automation 3 | Object=*\A..\control-source\NewTabCtl.vbp 4 | Form=frmMain.frm 5 | Form=frmTDIControlsTest.frm 6 | Form=frmIcons.frm 7 | Startup="frmMain" 8 | HelpFile="" 9 | Command32="" 10 | Name="NewTabTest" 11 | HelpContextID="0" 12 | CompatibleMode="0" 13 | MajorVer=1 14 | MinorVer=0 15 | RevisionVer=0 16 | AutoIncrementVer=0 17 | ServerSupportFiles=0 18 | VersionCompanyName="Empresa" 19 | CompilationType=0 20 | OptimizationType=0 21 | FavorPentiumPro(tm)=0 22 | CodeViewDebugInfo=0 23 | NoAliasing=0 24 | BoundsCheck=0 25 | OverflowCheck=0 26 | FlPointCheck=0 27 | FDIVCheck=0 28 | UnroundedFP=0 29 | StartMode=0 30 | Unattended=0 31 | Retained=0 32 | ThreadPerObject=0 33 | MaxNumberOfThreads=1 34 | 35 | [MS Transaction Server] 36 | AutoRefresh=1 37 | -------------------------------------------------------------------------------- /test in source code/frmIcons.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Object = "*\A..\control-source\NewTabCtl.vbp" 3 | Begin VB.Form frmIcons 4 | BorderStyle = 1 'Fixed Single 5 | Caption = "Icons" 6 | ClientHeight = 9516 7 | ClientLeft = 2844 8 | ClientTop = 1548 9 | ClientWidth = 10128 10 | BeginProperty Font 11 | Name = "Segoe UI" 12 | Size = 9 13 | Charset = 0 14 | Weight = 400 15 | Underline = 0 'False 16 | Italic = 0 'False 17 | Strikethrough = 0 'False 18 | EndProperty 19 | LinkTopic = "Form2" 20 | LockControls = -1 'True 21 | MaxButton = 0 'False 22 | MinButton = 0 'False 23 | ScaleHeight = 9516 24 | ScaleWidth = 10128 25 | Begin NewTabCtl.NewTab NewTab1 26 | Height = 2052 27 | Left = 360 28 | TabIndex = 0 29 | Top = 240 30 | Width = 4572 31 | _ExtentX = 8065 32 | _ExtentY = 3620 33 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 34 | Name = "Segoe UI" 35 | Size = 9 36 | Charset = 0 37 | Weight = 400 38 | Underline = 0 'False 39 | Italic = 0 'False 40 | Strikethrough = 0 'False 41 | EndProperty 42 | TabHeight = 643 43 | Themed = 0 'False 44 | AutoTabHeight = -1 'True 45 | TabIconChar(0) = 57605 46 | TabCaption(0) = "Tab 0" 47 | Tab(0).ControlCount= 0 48 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 49 | Name = "Segoe MDL2 Assets" 50 | Size = 13.8 51 | Charset = 0 52 | Weight = 400 53 | Underline = 0 'False 54 | Italic = 0 'False 55 | Strikethrough = 0 'False 56 | EndProperty 57 | IconFontName(0) = "Segoe MDL2 Assets" 58 | TabIconChar(1) = 57607 59 | TabCaption(1) = "Tab 1" 60 | Tab(1).ControlCount= 0 61 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 62 | Name = "Segoe MDL2 Assets" 63 | Size = 13.8 64 | Charset = 0 65 | Weight = 400 66 | Underline = 0 'False 67 | Italic = 0 'False 68 | Strikethrough = 0 'False 69 | EndProperty 70 | IconFontName(1) = "Segoe MDL2 Assets" 71 | TabIconChar(2) = 57621 72 | TabCaption(2) = "Tab 2" 73 | Tab(2).ControlCount= 0 74 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 75 | Name = "Segoe MDL2 Assets" 76 | Size = 13.8 77 | Charset = 0 78 | Weight = 400 79 | Underline = 0 'False 80 | Italic = 0 'False 81 | Strikethrough = 0 'False 82 | EndProperty 83 | IconFontName(2) = "Segoe MDL2 Assets" 84 | End 85 | Begin NewTabCtl.NewTab NewTab2 86 | Height = 2052 87 | Left = 360 88 | TabIndex = 2 89 | Top = 2520 90 | Width = 4572 91 | _ExtentX = 8065 92 | _ExtentY = 3620 93 | ForeColorTabSel = 10184001 94 | ForeColorHighlighted= 16777215 95 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 96 | Name = "Segoe UI" 97 | Size = 9 98 | Charset = 0 99 | Weight = 400 100 | Underline = 0 'False 101 | Italic = 0 'False 102 | Strikethrough = 0 'False 103 | EndProperty 104 | Style = 3 105 | TabHeight = 643 106 | Themed = 0 'False 107 | BackColorTabSel = 16250871 108 | FlatTabsSeparationLineColor= -2147483633 109 | FlatBorderColor = 10184001 110 | HighlightColor = 16477710 111 | IconAlignment = 3 112 | AutoTabHeight = -1 'True 113 | FlatRoundnessTabs= 8 114 | TabMousePointerHand= -1 'True 115 | IconColorTabSel = 10184001 116 | IconColorMouseHover= 16777215 117 | IconColorMouseHoverTabSel= 10184001 118 | IconColorTabHighlighted= 16777215 119 | HighlightMode = 4 120 | HighlightModeTabSel= 10 121 | FlatBorderMode = 1 122 | FlatBarHeight = 0 123 | TabIconChar(0) = 57605 124 | TabCaption(0) = "Tab 0" 125 | Tab(0).ControlCount= 0 126 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 127 | Name = "Segoe MDL2 Assets" 128 | Size = 13.8 129 | Charset = 0 130 | Weight = 400 131 | Underline = 0 'False 132 | Italic = 0 'False 133 | Strikethrough = 0 'False 134 | EndProperty 135 | IconFontName(0) = "Segoe MDL2 Assets" 136 | TabIconChar(1) = 57607 137 | TabCaption(1) = "Tab 1" 138 | Tab(1).ControlCount= 0 139 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 140 | Name = "Segoe MDL2 Assets" 141 | Size = 13.8 142 | Charset = 0 143 | Weight = 400 144 | Underline = 0 'False 145 | Italic = 0 'False 146 | Strikethrough = 0 'False 147 | EndProperty 148 | IconFontName(1) = "Segoe MDL2 Assets" 149 | TabIconChar(2) = 57621 150 | TabCaption(2) = "Tab 2" 151 | Tab(2).ControlCount= 0 152 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 153 | Name = "Segoe MDL2 Assets" 154 | Size = 13.8 155 | Charset = 0 156 | Weight = 400 157 | Underline = 0 'False 158 | Italic = 0 'False 159 | Strikethrough = 0 'False 160 | EndProperty 161 | IconFontName(2) = "Segoe MDL2 Assets" 162 | End 163 | Begin NewTabCtl.NewTab NewTab3 164 | Height = 2052 165 | Left = 360 166 | TabIndex = 4 167 | Top = 4800 168 | Width = 4572 169 | _ExtentX = 8065 170 | _ExtentY = 3620 171 | ForeColorTabSel = 16777215 172 | ForeColorHighlighted= 16731706 173 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 174 | Name = "Segoe UI" 175 | Size = 9 176 | Charset = 0 177 | Weight = 400 178 | Underline = 0 'False 179 | Italic = 0 'False 180 | Strikethrough = 0 'False 181 | EndProperty 182 | Style = 3 183 | TabHeight = 1522 184 | Themed = 0 'False 185 | BackColorTabs = 16250871 186 | FlatBarColorHighlight= 16250871 187 | FlatBarColorInactive= 16250871 188 | FlatTabsSeparationLineColor= 16250871 189 | FlatBodySeparationLineColor= 14869218 190 | FlatBorderColor = 16731706 191 | HighlightColor = 16477710 192 | HighlightColorTabSel= 16477710 193 | IconAlignment = 7 194 | AutoTabHeight = -1 'True 195 | FlatBarColorTabSel= 16731706 196 | FlatRoundnessTabs= 8 197 | TabMousePointerHand= -1 'True 198 | IconColorTabSel = 16777215 199 | IconColorMouseHover= 16731706 200 | IconColorMouseHoverTabSel= 16777215 201 | IconColorTabHighlighted= 16731706 202 | HighlightMode = 16 203 | HighlightModeTabSel= 20 204 | FlatBorderMode = 1 205 | FlatBarHeight = 4 206 | FlatBarPosition = 1 207 | TabIconChar(0) = 57615 208 | TabCaption(0) = "Tab 0" 209 | Tab(0).ControlCount= 0 210 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 211 | Name = "Segoe MDL2 Assets" 212 | Size = 24 213 | Charset = 0 214 | Weight = 400 215 | Underline = 0 'False 216 | Italic = 0 'False 217 | Strikethrough = 0 'False 218 | EndProperty 219 | IconFontName(0) = "Segoe MDL2 Assets" 220 | TabIconChar(1) = 57637 221 | TabCaption(1) = "Tab 1" 222 | Tab(1).ControlCount= 0 223 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 224 | Name = "Segoe MDL2 Assets" 225 | Size = 24 226 | Charset = 0 227 | Weight = 400 228 | Underline = 0 'False 229 | Italic = 0 'False 230 | Strikethrough = 0 'False 231 | EndProperty 232 | IconFontName(1) = "Segoe MDL2 Assets" 233 | TabIconChar(2) = 57626 234 | TabCaption(2) = "Tab 2" 235 | Tab(2).ControlCount= 0 236 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 237 | Name = "Segoe MDL2 Assets" 238 | Size = 24 239 | Charset = 0 240 | Weight = 400 241 | Underline = 0 'False 242 | Italic = 0 'False 243 | Strikethrough = 0 'False 244 | EndProperty 245 | IconFontName(2) = "Segoe MDL2 Assets" 246 | End 247 | Begin NewTabCtl.NewTab NewTab5 248 | Height = 2052 249 | Left = 5160 250 | TabIndex = 3 251 | Top = 2520 252 | Width = 4572 253 | _ExtentX = 8065 254 | _ExtentY = 3620 255 | ForeColor = 0 256 | ForeColorTabSel = 16777215 257 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 258 | Name = "Segoe UI" 259 | Size = 9 260 | Charset = 0 261 | Weight = 400 262 | Underline = 0 'False 263 | Italic = 0 'False 264 | Strikethrough = 0 'False 265 | EndProperty 266 | Style = 3 267 | TabHeight = 1522 268 | Themed = 0 'False 269 | BackColorTabSel = 16250871 270 | FlatTabsSeparationLineColor= 11250603 271 | FlatBodySeparationLineColor= 7699508 272 | FlatBorderColor = 7699508 273 | HighlightColor = 12766860 274 | HighlightColorTabSel= 7699508 275 | TabSeparation = 8 276 | IconAlignment = 8 277 | AutoTabHeight = -1 'True 278 | FlatBarColorTabSel= 7699508 279 | FlatRoundnessTabs= 8 280 | TabMousePointerHand= -1 'True 281 | IconColorTabSel = 16777215 282 | IconColorMouseHoverTabSel= 16777215 283 | HighlightMode = 4 284 | HighlightModeTabSel= 20 285 | FlatBorderMode = 1 286 | FlatBarHeight = 0 287 | FlatBodySeparationLineHeight= 3 288 | TabIconChar(0) = 57650 289 | TabCaption(0) = "Tab 0" 290 | Tab(0).ControlCount= 0 291 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 292 | Name = "Segoe MDL2 Assets" 293 | Size = 24 294 | Charset = 0 295 | Weight = 400 296 | Underline = 0 'False 297 | Italic = 0 'False 298 | Strikethrough = 0 'False 299 | EndProperty 300 | IconFontName(0) = "Segoe MDL2 Assets" 301 | TabIconChar(1) = 57637 302 | TabCaption(1) = "Tab 1" 303 | Tab(1).ControlCount= 0 304 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 305 | Name = "Segoe MDL2 Assets" 306 | Size = 24 307 | Charset = 0 308 | Weight = 400 309 | Underline = 0 'False 310 | Italic = 0 'False 311 | Strikethrough = 0 'False 312 | EndProperty 313 | IconFontName(1) = "Segoe MDL2 Assets" 314 | TabIconChar(2) = 57626 315 | TabCaption(2) = "Tab 2" 316 | Tab(2).ControlCount= 0 317 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 318 | Name = "Segoe MDL2 Assets" 319 | Size = 24 320 | Charset = 0 321 | Weight = 400 322 | Underline = 0 'False 323 | Italic = 0 'False 324 | Strikethrough = 0 'False 325 | EndProperty 326 | IconFontName(2) = "Segoe MDL2 Assets" 327 | End 328 | Begin NewTabCtl.NewTab NewTab6 329 | Height = 2052 330 | Left = 5160 331 | TabIndex = 5 332 | Top = 4800 333 | Width = 4572 334 | _ExtentX = 8065 335 | _ExtentY = 3620 336 | Tabs = 4 337 | ForeColor = 16777215 338 | ForeColorTabSel = 0 339 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 340 | Name = "Segoe UI" 341 | Size = 9 342 | Charset = 0 343 | Weight = 400 344 | Underline = 0 'False 345 | Italic = 0 'False 346 | Strikethrough = 0 'False 347 | EndProperty 348 | Style = 3 349 | TabHeight = 1734 350 | Themed = 0 'False 351 | BackColorTabs = 10646340 352 | BackColorTabSel = -2147483633 353 | FlatBarColorHighlight= 4228799 354 | FlatBarColorInactive= 10646340 355 | FlatTabsSeparationLineColor= 7434609 356 | FlatBodySeparationLineColor= 7434609 357 | FlatBorderColor = -2147483633 358 | HighlightColor = 10646340 359 | HighlightColorTabSel= -2147483633 360 | ChangeControlsForeColor= 0 'False 361 | TabSeparation = 8 362 | IconAlignment = 8 363 | AutoTabHeight = -1 'True 364 | FlatBarColorTabSel= 10646340 365 | FlatRoundnessTop= 0 366 | FlatRoundnessBottom= 0 367 | TabMousePointerHand= -1 'True 368 | IconColorTabSel = 0 369 | IconColorMouseHoverTabSel= 0 370 | HighlightMode = 196 371 | HighlightModeTabSel= 196 372 | FlatBarPosition = 1 373 | FlatBodySeparationLineHeight= 0 374 | TabIconChar(0) = 57650 375 | TabCaption(0) = "Tab 0" 376 | Tab(0).ControlCount= 0 377 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 378 | Name = "Segoe MDL2 Assets" 379 | Size = 24 380 | Charset = 0 381 | Weight = 400 382 | Underline = 0 'False 383 | Italic = 0 'False 384 | Strikethrough = 0 'False 385 | EndProperty 386 | IconFontName(0) = "Segoe MDL2 Assets" 387 | TabIconChar(1) = 57746 388 | TabCaption(1) = "Tab 1" 389 | Tab(1).ControlCount= 0 390 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 391 | Name = "Segoe MDL2 Assets" 392 | Size = 24 393 | Charset = 0 394 | Weight = 400 395 | Underline = 0 'False 396 | Italic = 0 'False 397 | Strikethrough = 0 'False 398 | EndProperty 399 | IconFontName(1) = "Segoe MDL2 Assets" 400 | TabIconChar(2) = 57626 401 | TabCaption(2) = "Tab 2" 402 | Tab(2).ControlCount= 0 403 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 404 | Name = "Segoe MDL2 Assets" 405 | Size = 24 406 | Charset = 0 407 | Weight = 400 408 | Underline = 0 'False 409 | Italic = 0 'False 410 | Strikethrough = 0 'False 411 | EndProperty 412 | IconFontName(2) = "Segoe MDL2 Assets" 413 | TabIconChar(3) = 57651 414 | TabCaption(3) = "Tab 3" 415 | Tab(3).ControlCount= 0 416 | BeginProperty IconFont(3) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 417 | Name = "Segoe MDL2 Assets" 418 | Size = 24 419 | Charset = 0 420 | Weight = 400 421 | Underline = 0 'False 422 | Italic = 0 'False 423 | Strikethrough = 0 'False 424 | EndProperty 425 | IconFontName(3) = "Segoe MDL2 Assets" 426 | End 427 | Begin NewTabCtl.NewTab NewTab7 428 | Height = 2052 429 | Left = 360 430 | TabIndex = 6 431 | Top = 7080 432 | Width = 4572 433 | _ExtentX = 8065 434 | _ExtentY = 3620 435 | Tabs = 4 436 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 437 | Name = "Segoe UI" 438 | Size = 9 439 | Charset = 0 440 | Weight = 400 441 | Underline = 0 'False 442 | Italic = 0 'False 443 | Strikethrough = 0 'False 444 | EndProperty 445 | TabOrientation = 1 446 | Style = 3 447 | TabHeight = 1776 448 | Themed = 0 'False 449 | BackColorTabs = 12766860 450 | BackColorTabSel = -2147483633 451 | FlatBarColorHighlight= 7699508 452 | FlatBarColorInactive= 12766860 453 | FlatTabsSeparationLineColor= -2147483633 454 | FlatBodySeparationLineColor= 7699508 455 | FlatBorderColor = 7699508 456 | HighlightColor = 12766860 457 | HighlightColorTabSel= -2147483633 458 | TabSeparation = 8 459 | IconAlignment = 8 460 | AutoTabHeight = -1 'True 461 | FlatBarColorTabSel= 7699508 462 | FlatRoundnessTop= 4 463 | FlatRoundnessBottom= 4 464 | FlatRoundnessTabs= 4 465 | TabMousePointerHand= -1 'True 466 | HighlightMode = 196 467 | HighlightModeTabSel= 196 468 | FlatBorderMode = 1 469 | FlatBarHeight = 5 470 | FlatBarPosition = 1 471 | TabIconChar(0) = 57350 472 | TabCaption(0) = "Tab 0" 473 | Tab(0).ControlCount= 0 474 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 475 | Name = "Segoe MDL2 Assets" 476 | Size = 24 477 | Charset = 0 478 | Weight = 400 479 | Underline = 0 'False 480 | Italic = 0 'False 481 | Strikethrough = 0 'False 482 | EndProperty 483 | IconFontName(0) = "Segoe MDL2 Assets" 484 | TabIconChar(1) = 57637 485 | TabCaption(1) = "Tab 1" 486 | Tab(1).ControlCount= 0 487 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 488 | Name = "Segoe MDL2 Assets" 489 | Size = 24 490 | Charset = 0 491 | Weight = 400 492 | Underline = 0 'False 493 | Italic = 0 'False 494 | Strikethrough = 0 'False 495 | EndProperty 496 | IconFontName(1) = "Segoe MDL2 Assets" 497 | TabIconChar(2) = 57626 498 | TabCaption(2) = "Tab 2" 499 | Tab(2).ControlCount= 0 500 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 501 | Name = "Segoe MDL2 Assets" 502 | Size = 24 503 | Charset = 0 504 | Weight = 400 505 | Underline = 0 'False 506 | Italic = 0 'False 507 | Strikethrough = 0 'False 508 | EndProperty 509 | IconFontName(2) = "Segoe MDL2 Assets" 510 | TabIconChar(3) = 59265 511 | TabCaption(3) = "Tab 3" 512 | Tab(3).ControlCount= 0 513 | BeginProperty IconFont(3) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 514 | Name = "Segoe MDL2 Assets" 515 | Size = 24 516 | Charset = 0 517 | Weight = 400 518 | Underline = 0 'False 519 | Italic = 0 'False 520 | Strikethrough = 0 'False 521 | EndProperty 522 | IconFontName(3) = "Segoe MDL2 Assets" 523 | End 524 | Begin NewTabCtl.NewTab NewTab8 525 | Height = 2052 526 | Left = 5160 527 | TabIndex = 7 528 | Top = 7080 529 | Width = 4572 530 | _ExtentX = 8065 531 | _ExtentY = 3620 532 | ForeColorTabSel = 10184001 533 | ForeColorHighlighted= 16777215 534 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 535 | Name = "Segoe UI" 536 | Size = 9 537 | Charset = 0 538 | Weight = 400 539 | Underline = 0 'False 540 | Italic = 0 'False 541 | Strikethrough = 0 'False 542 | EndProperty 543 | TabOrientation = 1 544 | Style = 3 545 | TabHeight = 1522 546 | Themed = 0 'False 547 | BackColorTabSel = 16250871 548 | FlatTabsSeparationLineColor= -2147483633 549 | FlatBorderColor = 10184001 550 | HighlightColor = 16477710 551 | IconAlignment = 8 552 | AutoTabHeight = -1 'True 553 | FlatRoundnessTabs= 8 554 | TabMousePointerHand= -1 'True 555 | IconColorTabSel = 10184001 556 | IconColorMouseHover= 16777215 557 | IconColorMouseHoverTabSel= 10184001 558 | IconColorTabHighlighted= 16777215 559 | HighlightMode = 4 560 | HighlightModeTabSel= 10 561 | FlatBorderMode = 1 562 | FlatBarHeight = 0 563 | TabIconChar(0) = 57350 564 | TabCaption(0) = "Tab 0" 565 | Tab(0).ControlCount= 0 566 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 567 | Name = "Segoe MDL2 Assets" 568 | Size = 24 569 | Charset = 0 570 | Weight = 400 571 | Underline = 0 'False 572 | Italic = 0 'False 573 | Strikethrough = 0 'False 574 | EndProperty 575 | IconFontName(0) = "Segoe MDL2 Assets" 576 | TabIconChar(1) = 57637 577 | TabCaption(1) = "Tab 1" 578 | Tab(1).ControlCount= 0 579 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 580 | Name = "Segoe MDL2 Assets" 581 | Size = 24 582 | Charset = 0 583 | Weight = 400 584 | Underline = 0 'False 585 | Italic = 0 'False 586 | Strikethrough = 0 'False 587 | EndProperty 588 | IconFontName(1) = "Segoe MDL2 Assets" 589 | TabIconChar(2) = 57626 590 | TabCaption(2) = "Tab 2" 591 | Tab(2).ControlCount= 0 592 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 593 | Name = "Segoe MDL2 Assets" 594 | Size = 24 595 | Charset = 0 596 | Weight = 400 597 | Underline = 0 'False 598 | Italic = 0 'False 599 | Strikethrough = 0 'False 600 | EndProperty 601 | IconFontName(2) = "Segoe MDL2 Assets" 602 | End 603 | Begin NewTabCtl.NewTab NewTab4 604 | Height = 2052 605 | Left = 5160 606 | TabIndex = 1 607 | Top = 240 608 | Width = 4572 609 | _ExtentX = 8065 610 | _ExtentY = 3620 611 | Tabs = 5 612 | ForeColorTabSel = 16731706 613 | ForeColorHighlighted= 16731706 614 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 615 | Name = "Segoe UI" 616 | Size = 9 617 | Charset = 0 618 | Weight = 400 619 | Underline = 0 'False 620 | Italic = 0 'False 621 | Strikethrough = 0 'False 622 | EndProperty 623 | Style = 3 624 | TabHeight = 1235 625 | Themed = 0 'False 626 | BackColorTabs = 16250871 627 | FlatBarColorHighlight= 16250871 628 | FlatBarColorInactive= 16250871 629 | FlatTabsSeparationLineColor= 16250871 630 | FlatBodySeparationLineColor= 14869218 631 | FlatBorderColor = 16250871 632 | HighlightColor = 16477710 633 | IconAlignment = 6 634 | FlatBarColorTabSel= 16731706 635 | FlatRoundnessTop= 0 636 | FlatRoundnessBottom= 0 637 | TabMousePointerHand= -1 'True 638 | IconColorTabSel = 16731706 639 | IconColorMouseHover= 16731706 640 | IconColorMouseHoverTabSel= 16731706 641 | IconColorTabHighlighted= 16731706 642 | HighlightMode = 1 643 | HighlightModeTabSel= 1 644 | FlatBarHeight = 4 645 | FlatBarPosition = 1 646 | TabIconChar(0) = 57699 647 | Tab(0).ControlCount= 0 648 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 649 | Name = "Segoe MDL2 Assets" 650 | Size = 24 651 | Charset = 0 652 | Weight = 400 653 | Underline = 0 'False 654 | Italic = 0 'False 655 | Strikethrough = 0 'False 656 | EndProperty 657 | IconFontName(0) = "Segoe MDL2 Assets" 658 | TabIconChar(1) = 57637 659 | Tab(1).ControlCount= 0 660 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 661 | Name = "Segoe MDL2 Assets" 662 | Size = 24 663 | Charset = 0 664 | Weight = 400 665 | Underline = 0 'False 666 | Italic = 0 'False 667 | Strikethrough = 0 'False 668 | EndProperty 669 | IconFontName(1) = "Segoe MDL2 Assets" 670 | TabIconChar(2) = 57626 671 | Tab(2).ControlCount= 0 672 | BeginProperty IconFont(2) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 673 | Name = "Segoe MDL2 Assets" 674 | Size = 24 675 | Charset = 0 676 | Weight = 400 677 | Underline = 0 'False 678 | Italic = 0 'False 679 | Strikethrough = 0 'False 680 | EndProperty 681 | IconFontName(2) = "Segoe MDL2 Assets" 682 | TabIconChar(3) = 57604 683 | Tab(3).ControlCount= 0 684 | BeginProperty IconFont(3) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 685 | Name = "Segoe MDL2 Assets" 686 | Size = 24 687 | Charset = 0 688 | Weight = 400 689 | Underline = 0 'False 690 | Italic = 0 'False 691 | Strikethrough = 0 'False 692 | EndProperty 693 | IconFontName(3) = "Segoe MDL2 Assets" 694 | TabIconChar(4) = 57615 695 | Tab(4).ControlCount= 0 696 | BeginProperty IconFont(4) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 697 | Name = "Segoe MDL2 Assets" 698 | Size = 24 699 | Charset = 0 700 | Weight = 400 701 | Underline = 0 'False 702 | Italic = 0 'False 703 | Strikethrough = 0 'False 704 | EndProperty 705 | IconFontName(4) = "Segoe MDL2 Assets" 706 | End 707 | End 708 | Attribute VB_Name = "frmIcons" 709 | Attribute VB_GlobalNameSpace = False 710 | Attribute VB_Creatable = False 711 | Attribute VB_PredeclaredId = True 712 | Attribute VB_Exposed = False 713 | Option Explicit 714 | 715 | -------------------------------------------------------------------------------- /test in source code/frmMain.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Object = "*\A..\control-source\NewTabCtl.vbp" 3 | Begin VB.Form frmMain 4 | BorderStyle = 1 'Fixed Single 5 | Caption = "NewTab sample" 6 | ClientHeight = 4716 7 | ClientLeft = 1524 8 | ClientTop = 1932 9 | ClientWidth = 5844 10 | BeginProperty Font 11 | Name = "Tahoma" 12 | Size = 9 13 | Charset = 0 14 | Weight = 400 15 | Underline = 0 'False 16 | Italic = 0 'False 17 | Strikethrough = 0 'False 18 | EndProperty 19 | LinkTopic = "Form1" 20 | LockControls = -1 'True 21 | MaxButton = 0 'False 22 | MinButton = 0 'False 23 | ScaleHeight = 4716 24 | ScaleWidth = 5844 25 | Begin VB.CommandButton Command2 26 | Caption = "Check some tabs with fonts icons" 27 | Height = 370 28 | Left = 360 29 | TabIndex = 4 30 | Top = 4080 31 | Width = 5130 32 | End 33 | Begin VB.CommandButton Command1 34 | Caption = "Test TDI Controls mode (TDI: Tabbed Document Interface)" 35 | Height = 370 36 | Left = 360 37 | TabIndex = 3 38 | Top = 3600 39 | Width = 5130 40 | End 41 | Begin VB.ComboBox cboThemes 42 | Height = 312 43 | Left = 1050 44 | Style = 2 'Dropdown List 45 | TabIndex = 1 46 | Top = 120 47 | Width = 4440 48 | End 49 | Begin NewTabCtl.NewTab NewTab1 50 | Height = 2530 51 | Left = 360 52 | TabIndex = 2 53 | Top = 720 54 | Width = 5130 55 | _ExtentX = 9059 56 | _ExtentY = 4466 57 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 58 | Name = "Tahoma" 59 | Size = 9 60 | Charset = 0 61 | Weight = 400 62 | Underline = 0 'False 63 | Italic = 0 'False 64 | Strikethrough = 0 'False 65 | EndProperty 66 | TabHeight = 600 67 | Themed = 0 'False 68 | AutoTabHeight = -1 'True 69 | TabCaption(0) = "Tab 0" 70 | Tab(0).ControlCount= 0 71 | TabCaption(1) = "Tab 1" 72 | Tab(1).ControlCount= 0 73 | TabCaption(2) = "Tab 2" 74 | Tab(2).ControlCount= 0 75 | End 76 | Begin VB.Label Label1 77 | Caption = "Theme:" 78 | Height = 250 79 | Left = 360 80 | TabIndex = 0 81 | Top = 150 82 | Width = 730 83 | End 84 | End 85 | Attribute VB_Name = "frmMain" 86 | Attribute VB_GlobalNameSpace = False 87 | Attribute VB_Creatable = False 88 | Attribute VB_PredeclaredId = True 89 | Attribute VB_Exposed = False 90 | Option Explicit 91 | 92 | Private Sub cboThemes_Click() 93 | NewTab1.Theme = cboThemes.Text 94 | End Sub 95 | 96 | Private Sub Command1_Click() 97 | frmTDIControlsTest.Show vbModal 98 | End Sub 99 | 100 | Private Sub Command2_Click() 101 | frmIcons.Show vbModal 102 | End Sub 103 | 104 | Private Sub Form_Load() 105 | Dim iTheme As NewTabTheme 106 | 107 | For Each iTheme In NewTab1.Themes 108 | cboThemes.AddItem iTheme.Name 109 | Next 110 | cboThemes.ListIndex = 0 111 | End Sub 112 | -------------------------------------------------------------------------------- /test in source code/frmTDIControlsTest.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Object = "*\A..\control-source\NewTabCtl.vbp" 3 | Begin VB.Form frmTDIControlsTest 4 | Caption = "TDI" 5 | ClientHeight = 5748 6 | ClientLeft = 2964 7 | ClientTop = 2568 8 | ClientWidth = 7680 9 | BeginProperty Font 10 | Name = "Tahoma" 11 | Size = 9 12 | Charset = 0 13 | Weight = 400 14 | Underline = 0 'False 15 | Italic = 0 'False 16 | Strikethrough = 0 'False 17 | EndProperty 18 | LinkTopic = "Form2" 19 | ScaleHeight = 5748 20 | ScaleWidth = 7680 21 | StartUpPosition = 2 'CenterScreen 22 | Begin NewTabCtl.NewTab NewTab1 23 | Height = 2530 24 | Left = 0 25 | TabIndex = 0 26 | Top = 0 27 | Width = 5290 28 | _ExtentX = 9335 29 | _ExtentY = 4466 30 | ControlJustAdded= 0 'False 31 | Tabs = 2 32 | ForeColorSelectedTab= 10184001 33 | ForeColorHighlighted= 16777215 34 | BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 35 | Name = "Tahoma" 36 | Size = 9 37 | Charset = 0 38 | Weight = 400 39 | Underline = 0 'False 40 | Italic = 0 'False 41 | Strikethrough = 0 'False 42 | EndProperty 43 | Style = 3 44 | TabHeight = 631 45 | BackColorSelectedTab= 16250871 46 | FlatBarColorInactive= 14211288 47 | FlatBorderColor = 10184001 48 | HighlightColor = 16477710 49 | IconAlignment = 5 50 | AutoTabHeight = -1 'True 51 | FlatRoundnessTabs= 8 52 | TabMousePointerHand= -1 'True 53 | IconColorMouseHover= 255 54 | IconColorMouseHoverSelectedTab= 255 55 | IconColorTabHighlighted= 16777215 56 | HighlightMode = 12 57 | HighlightModeSelectedTab= 10 58 | FlatBorderMode = 1 59 | FlatBarHeight = 0 60 | CanReorderTabs = -1 'True 61 | TDIMode = 1 62 | ControlVersion = 11 63 | TabIconChar(0) = 57606 64 | TabIconLeftOffset(0)= -3 65 | TabIconTopOffset(0)= 1 66 | TabCaption(0) = "New tab template " 67 | Tab(0).ControlCount= 4 68 | Tab(0).Control(0)= "txtDoc(0)" 69 | Tab(0).Control(1)= "Command1(0)" 70 | Tab(0).Control(2)= "txtSearch(0)" 71 | Tab(0).Control(3)= "Label1(0)" 72 | BeginProperty IconFont(0) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 73 | Name = "Segoe MDL2 Assets" 74 | Size = 10.2 75 | Charset = 0 76 | Weight = 700 77 | Underline = 0 'False 78 | Italic = 0 'False 79 | Strikethrough = 0 'False 80 | EndProperty 81 | IconFontName(0) = "Segoe MDL2 Assets" 82 | TabIconChar(1) = 63658 83 | TabIconLeftOffset(1)= -2 84 | TabIconTopOffset(1)= 1 85 | TabCaption(1) = "" 86 | TabToolTipText(1)= "Add a new tab" 87 | BeginProperty IconFont(1) {0BE35203-8F91-11CE-9DE3-00AA004BB851} 88 | Name = "Segoe MDL2 Assets" 89 | Size = 13.8 90 | Charset = 0 91 | Weight = 700 92 | Underline = 0 'False 93 | Italic = 0 'False 94 | Strikethrough = 0 'False 95 | EndProperty 96 | IconFontName(1) = "Segoe MDL2 Assets" 97 | Begin VB.TextBox txtDoc 98 | Appearance = 0 'Flat 99 | Height = 1210 100 | Index = 0 101 | Left = 120 102 | MultiLine = -1 'True 103 | TabIndex = 4 104 | Top = 1140 105 | Width = 5050 106 | End 107 | Begin VB.CommandButton Command1 108 | BackColor = &H00F7F7F7& 109 | Caption = "Do something" 110 | Height = 370 111 | Index = 0 112 | Left = 3840 113 | TabIndex = 3 114 | Top = 540 115 | Width = 1330 116 | End 117 | Begin VB.TextBox txtSearch 118 | Appearance = 0 'Flat 119 | Height = 370 120 | Index = 0 121 | Left = 1320 122 | TabIndex = 2 123 | Top = 540 124 | Width = 2410 125 | End 126 | Begin VB.Label Label1 127 | Alignment = 1 'Right Justify 128 | BackColor = &H00F7F7F7& 129 | Caption = "Search:" 130 | ForeColor = &H009B6541& 131 | Height = 370 132 | Index = 0 133 | Left = 240 134 | TabIndex = 1 135 | Top = 590 136 | Width = 970 137 | End 138 | End 139 | Begin VB.Label Label2 140 | Caption = "TDI: Tabbed Document Interface. To use the TDI Mode 'Controls', set the TDIMode property to 'ntTDIModeControls'." 141 | Height = 972 142 | Left = 600 143 | TabIndex = 5 144 | Top = 3000 145 | Visible = 0 'False 146 | Width = 4452 147 | End 148 | End 149 | Attribute VB_Name = "frmTDIControlsTest" 150 | Attribute VB_GlobalNameSpace = False 151 | Attribute VB_Creatable = False 152 | Attribute VB_PredeclaredId = True 153 | Attribute VB_Exposed = False 154 | Option Explicit 155 | 156 | Private Sub Form_Resize() 157 | Dim c As Long 158 | 159 | NewTab1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight 160 | 161 | For c = 0 To NewTab1.Tabs - 2 162 | If NewTab1.TabVisible(c) Then 163 | PositionAndResizeControlsInTab c 164 | End If 165 | Next 166 | End Sub 167 | 168 | Private Sub NewTab1_TDINewTabAdded(ByVal TabNumber As Long) 169 | PositionAndResizeControlsInTab TabNumber 170 | End Sub 171 | 172 | Private Sub PositionAndResizeControlsInTab(TabNumber As Long) 173 | NewTab1.ControlMove "txtDoc(" & TabNumber & ")", Screen.TwipsPerPixelX, NewTab1.ClientTop + 700, NewTab1.ClientWidth, NewTab1.ClientHeight - 700 - Screen.TwipsPerPixelY 174 | End Sub 175 | 176 | --------------------------------------------------------------------------------