-
NewTab: tab control for VB6
Download from GitHub.
This is a tab control based on previous control SSTabEx.
This new control keeps backward compatibility with the original SSTab that came with VB6 and is mostly backward compatible also with SSTabEx, although some properties have changed.
It introduces the flat style and several properties related to it.
It also adds many new features not only related to flat style, for example:
Soft tab transitions (see TabTransition property, thanks LeandroA).
Icons from fonts (thanks Shagratt).
Tab dragging to another position (see CanReorderTabs property).
Tabbed Document Interface mode (see TDIMode property).
Since it has now many properties, it is hard to remember how to configure something specific that we like, so it introduces the feature of "Themes". Themes are property presets that primarily define appearance but also some behavior.
They can be stored as a file, optionally in the registry and in the control properties. If offers several themes by default but you can add your own ones.
There is a Themes property that exposes the Themes collection, and a Theme property where you can set one by its name.
Documentation online.
https://www.vbforums.com/images/ieimages/2022/11/4.png
https://www.vbforums.com/images/ieimages/2022/11/5.png
Download from GitHub.
-
Re: NewTab: tab control for VB6
Steps for replacing SSTab with NewTab in a project:
- Make a backup of your original project.
- Open the project in the IDE and from menu Project, Components, select NewTab for VB6, then click OK.
- Save the project and close the IDE.
- Not required but if you open the vbp file with Notepad now you should see this line:
Object={66E63055-5A66-4C79-9327-4BC077858695}#14.0#0; NewTab01.ocx - Now you need to open with Notepad or other text editor each *.frm file and replace the text 'TabDlg.SSTab' with 'NewTabCtl.NewTab'
If you have many forms you can use a program to make a global text replace in all the *.frm files in a folder at once, I use TextRep available here. - Open the project in the IDE and go to menu Project, Components, and deselect Microsoft Tabbed Dialog Control 6.0, click OK.
- Save the project.
Code for the manifest file to make a SxS installation:
Code:
<file name="NewTab01.ocx">
<typelib tlbid="{66E63055-5A66-4C79-9327-4BC077858695}" version="14.0" flags="control" helpdir="" />
<comClass clsid="{D9DACE39-8348-4FC3-8BBF-9178D817C34B}" tlbid="{66E63055-5A66-4C79-9327-4BC077858695}" threadingModel="Apartment" progid="NewTabCtl.NewTab" miscStatusIcon="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,alignable,simpleframe,setclientsitefirst" description="NewTab: tabbed control" />
</file>
-
Re: NewTab: tab control for VB6
Very good work Eduardo, an excellent final result :wave:
-
Re: NewTab: tab control for VB6
@Eduardo-,
I'm working on a code editor whose interface will emulate VSCode. So I need a lightweight TabCtrl(PageCtrl) similar to VSCode, and I don't know if your new TabControl can emulate VSCode's TabCtrl(PageCtrl).
Also, SSTabEx is too heavy and complex to be considered by me.
Edit:
VSCode's TabCtrl(PageCtrl) provides "window splitting" feature, just like a Container-Splitter.
-
Re: NewTab: tab control for VB6
Very good work.
I've used STabEx a lot and this one looks much better.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
SearchingDataOnly
@Eduardo-,
I'm working on a code editor whose interface will emulate VSCode. So I need a lightweight TabCtrl(PageCtrl) similar to VSCode, and I don't know if your new TabControl can emulate VSCode's TabCtrl(PageCtrl).
Also, SSTabEx is too heavy and complex to be considered by me.
Edit:
VSCode's TabCtrl(PageCtrl) provides "window splitting" feature, just like a Container-Splitter.
Maybe this will do, since you use RC6. Just change the drawing styles if you prefer a different look.
https://www.vbforums.com/showthread....(Firefox-like)
-
Re: NewTab: tab control for VB6
thanks for shares and i sent some issue in githube ,i sent some videos or screen shot animated about it,i dont know its about my windows tested in (new installed xp and vb only) and win 8 64 bit too or etc
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
ColinE66
I studied your controls carefully and it's fantastic. Thank you very much.
Also, I've been trying to find an example of developing CodeEditor in RC6. You're a master of controls, and it would be great if you could provide some help.
-
Re: NewTab: tab control for VB6
Excellent control, thanks for sharing :)
-
Re: NewTab: tab control for VB6
Thanks for all the comments :wave:.
Updated:
2022-11-15 OLE OCX version changed to 2 because binary compatibility was broken.
2022-11-15 Added two new default themes.
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.
2022-11-14 Improvements in tab dragging (changing tab position when CanReorderTabs = True).
2022-11-12 Added middle click handling to tabs in TDIMode.
-
Re: NewTab: tab control for VB6
Just today, just a while ago only, I noticed this new control. Great! Wow! Thanks a many.
One quick question:
Actually, I wanted this in SSTabEx itself. i.e. is it possible to have Unicode tooltips for the Tab (as a whole) as well as for the individual Tabs? If that feature is already available, then kindly let me know how to set texts in Unicode as tooltips for the Tabs (and the Tab, as a whole, as well)?
Thanks once again, for all your wonderful controls.
Kind Regards.
-
Re: NewTab: tab control for VB6
Hello softv. No, the tooltips are not Unicode currently but I'll keep in mind the request.
-
Re: NewTab: tab control for VB6
I added Unicode support for the TabToolTipText property (*).
On the other hand, the ToolTipText property is handled by VB and does not support Unicode (anyway I don't imagine a situation where someone could need a tool tip for the whole control).
Please test.
(*) You can set the TabToolTipText for each tab at design time from the 'Tabs' property page.
-
Re: NewTab: tab control for VB6
So quickly!!! You are one great soul, Eduardo. Thanks a TON. I did download and test the latest version. I was able to set and see Unicode text, not only in the ToolTips but in Captions too!!! Wow! Actually, Unicode in Tab Captions would have been my next request. But, I am able to see it now itself. Fantastic. Great many great many thanks.
But, one thing. I was able to achieve the above via code only. Though that itself is quite immense and totally enough for me, since you have written that its possible to set the Unicode text at design time itself!!!, I wish to give the following feedback (for setting the ToolTipText in Unicode via 'Properties' page alone and not via code):
--
The Unicode characters (for a tab's tooltip) change to questions marks, as soon as the 'Properties' window is closed. So, the tab's tooltip's text also appears as question marks only, during runtime. May be I am doing some mistake because I just gave it a quick-test only, because of lack of time (as of now).
In case if its a mistake from my side only, then kindly please let me what mistake I am doing. In case its not a mistake from my side, then, I am sure you will release the next version where things are set right. So, in either case, thanks a TON for the Unicode support in ToolTipText at Design time itself!!!!! Unicode support for ToolTip texts (as well as Captions, if possible - since it is possible via code now) at design time would be a huge time-saver and an absolute treat for me.
Anyway, as already mentioned by me, "Tab ToolTip and Caption texts via code" - that itself is Immense. Thanks a TON, once again.
--
Yes, Unicode support for the whole control's ToolTip text is not much of a need.
Kind Regards.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
softv
So quickly!!! You are one great soul, Eduardo. Thanks a TON. I did download and test the latest version. I was able to set and see Unicode text, not only in the ToolTips but in Captions too!!! Wow! Actually, Unicode in Tab Captions would have been my next request. But, I am able to see it now itself. Fantastic. Great many great many thanks.
The Unicode captions were available from the first version of SSTabEx... I mean, the tab captions have been always Unicode capable through code.
Not the Tab tooltips, because they used the standard VB extender tooltip mechanism that is ANSI based.
(But now I changed them to use API, and they are Uniocode capable now).
Quote:
Originally Posted by
softv
But, one thing. I was able to achieve the above via code only. Though that itself is quite immense and totally enough for me, since you have written that its possible to set the Unicode text at design time itself!!!, I wish to give the following feedback (for setting the ToolTipText in Unicode via 'Properties' page alone and not via code):
--
The Unicode characters (for a tab's tooltip) change to questions marks, as soon as the 'Properties' window is closed. So, the tab's tooltip's text also appears as question marks only, during runtime. May be I am doing some mistake because I just gave it a quick-test only, because of lack of time (as of now).
In case if its a mistake from my side only, then kindly please let me what mistake I am doing. In case its not a mistake from my side, then, I am sure you will release the next version where things are set right. So, in either case, thanks a TON for the Unicode support in ToolTipText at Design time itself!!!!! Unicode support for ToolTip texts (as well as Captions, if possible - since it is possible via code now) at design time would be a huge time-saver and an absolute treat for me.
Anyway, as already mentioned by me, "Tab ToolTip and Caption texts via code" - that itself is Immense. Thanks a TON, once again.
--
Yes, Unicode support for the whole control's ToolTip text is not much of a need.
Kind Regards.
Yes, you are right, the captions and tooltips set from the property page are not Unicode capable. The reason: I use normal VB textboxes there, and the VB textboxes are not Unicode capable.
To make it possible to enter Unicode at design time, I should incorporate a Unicode capable textbox into the project. In that case I think I should try to find some simple usercontrol that allows basic Unicode text entering, because a full featured Unicode textbox would mean to add several files. Not sure whether it worth...
-
Re: NewTab: tab control for VB6
// To make it possible to enter Unicode at design time, I should incorporate a Unicode capable textbox into the project. In that case I think I should try to find some simple usercontrol that allows basic Unicode text entering, because a full featured Unicode textbox would mean to add several files. //
Please see this - https://www.vbforums.com/showthread....-Shape-Control - posted by LaVolpe more than a decade back
If you have already seen the above control and thus you are very well aware about the technique used by LaVolpe in his above project to hold Unicode text in text boxes during design time itself but you feel it is not feasible to adopt that technique in Newtab, then no need to read the following. Otherwise, kindly please do read ahead.
LaVolpe's control is a 'Shape' control actually. But, the control takes 'Text' also as one of its forms (apart from rectangle, ellipse, polygon, etc.)
The 'Text' property is accessible via the 'Properties' page. As in the case of NewTab control, one can right click on this control also & select "Properties" for a new 'Properties' screen to get displayed. Therein, one can choose 'Text' (from a listbox) for the 'Shape' field and in the 'Text' field, one can key in Unicode text.
LaVolpe has mentioned in one of his messages (in his abovementioned post) as follows:
--
ShapeText. To enable unicode during design time, use the property page. ShapeText property accepts unicode during runtime also.
--
On my testing, the entered Unicode text is maintained at all times in LaVolpe's Shape control, once it has been input in the 'Text' field.
I find a "cUniTextBox.cls" class in LaVolpe's project wherein he has mentioned in that class' documentation (at the very start itself)
--
' A simple callback class used to offer unicode textbox on the property page
' It is truly simple and only has a couple properties/methods, but works well
' Should you want to use this for your own projects, here is how you can set it up
... .. .
...
..
.
--
I have just shared above what I found. That's all. LaVolpe's project has only one text box but NewTab has 'as many textboxes' as there are tabs. So, the technique used by LaVolpe may be too much of a work for NewTab, to safely hold the Unicode texts, persistently, at both Design and Runtime. But then, I am not an expert like you. So, as an expert, if you feel, it would not be too much of a work to adopt LaVolpe's technique in NewTab, then you may kindly proceed ahead to adop it. It would be a treat to see Unicode text entered for tabs' ToolTips at Design time itself.
All said and done, as already mentioned by me in my earlier message, "Tab ToolTip and Caption texts via code" - that itself is Immense. Thanks a TON, once again.
Kind Regards.
-
Re: NewTab: tab control for VB6
Thanks, something like that I was talking about when I said "something simple".
Quote:
Originally Posted by
softv
NewTab has 'as many textboxes' as there are tabs.
No, it has only one TextBox per property, the data for each tab is stored in an array variable (Private mTabData() As T_TabDataP).
OK, I'll see to implement that (at some point).
Thank you.
-
Re: NewTab: tab control for VB6
Done, please test.
One thing that I noticed and didn't like is that the arrows keys don't work (to change the insertion position).
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
Done, please test.
One thing that I noticed and didn't like is that the arrows keys don't work (to change the insertion position).
Yes, its working great and really nice to see Caption and Tooltip accepting Unicode text at design time itself.
But, as you say, the arrow keys do not work as intended. They are shifting focus to the previous or next fields. I needed to press the arrow keys twice, initially, to notice this behaviour. This behaviour could be definitely irksome for most (if not all), I feel, personally. So, if this issue can be set right only, it would be ideal for most, I feel, personally. And, of course, it would feel great too, for me, as I requested this feature very much. But, in case this issue cannot be set right, I don't know what you would plan to do. As for me, I can live with this issue, since I would always love to see Unicode in Caption and Tooltips at design time. Anyway, as written earlier, "Unicode texts for Tab ToolTip and Caption via code" - that itself was immense. Thanks a TON, once again.
Kind Regards.
-
1 Attachment(s)
Re: NewTab: tab control for VB6
If you want, you can share "themes" with other users by posting them here.
You can do it from the "Themes" property page and the "Copy this theme" button:
Attachment 186386
Then post it here.
(Everybody is invited.)
-
2 Attachment(s)
Re: NewTab: tab control for VB6
Attachment 186467
It's a bit hard to see, but I'm getting error 91 when exiting my project (in the IDE) that has your tab control.
I've attached the offending project. Be sure to open with the PersistentDebugPrint.VBG file.
All I did to your NewTabCtl was to pull all the source files into one folder, remove any compatibility requirements, edit the NewTabCtl.vbp to remove the path specifications, and then include the project within the PersistentDebugPrint.VBG file. I also played around with a few of your properties from your properties window, but that's it.
To get it going, I just expanded the scope of your OERN that you already had. My changes to get it going:
Code:
On Error Resume Next
For c = 1 To mSubclassedControlsForPaintingHwnds.Count
iHwnd = mSubclassedControlsForPaintingHwnds(c)
DetachMessage Me, iHwnd, WM_PAINT
DetachMessage Me, iHwnd, WM_MOVE
Next c
Set mSubclassedControlsForPaintingHwnds = Nothing
For c = 1 To mSubclassedFramesHwnds.Count
iHwnd = mSubclassedFramesHwnds(c)
DetachMessage Me, iHwnd, WM_PRINTCLIENT
DetachMessage Me, iHwnd, WM_MOUSELEAVE
Next c
Set mSubclassedFramesHwnds = Nothing
For c = 1 To mSubclassedControlsForMoveHwnds.Count
iHwnd = mSubclassedControlsForMoveHwnds(c)
DetachMessage Me, iHwnd, WM_WINDOWPOSCHANGING
Next c
Set mSubclassedControlsForMoveHwnds = Nothing
mTabIconFontsEventsHandler.Release
Set mTabIconFontsEventsHandler = Nothing
If mHandIconHandle <> 0 Then
DestroyCursor mHandIconHandle
mHandIconHandle = 0
End If
On Error GoTo 0
All in the DoTerminate procedure within the ctlNewTabCtl.ctl file. Attached doesn't have this fix. It's your original code.
-
Re: NewTab: tab control for VB6
Hmmm, I'm also trying to use your TDIMode feature.
However, when you X (close) a tab, it appears to just hide it rather than truly close it, and it also leaves that tab's index active. Done that way, it sure makes it tough to keep track of things.
I was hoping to just number my tabs 1, 2, 3, etc, and be able to reference those tabs with those numbers. If one were deleted, I'd just re-number all the subsequent captions. But, I can't do that with the way it works (without making some kind of complex cross-reference index).
Maybe I should just do my own version of TDI with your control. I'd also like the ability to prohibit closing certain tabs (and haven't yet looked to see if that's a tab property).
EDIT: I found your TDIGetTabNumberByTabIndex and TDIGetTabIndexByTabNumber properties. That's probably what I need. I'll see if I can figure how what they're telling me.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Elroy
Attachment 186467
It's a bit hard to see, but I'm getting error 91 when exiting my project (in the IDE) that has your tab control.
I've attached the offending project. Be sure to open with the PersistentDebugPrint.VB
G file.
The issue is that you are reloading the form from its Form_Terminate event, that's of course something that shouldn't be happening.
It happens here:
Code:
Private Sub Form_Terminate()
'
' Remove our subclassing so we can safely remove its related thunk.
RemoveWindowSubclass Me.hWnd, pMessageThunkPointer, Me.hWnd
If you access any property after a form was unloaded, you load it again.
The Form_Load event does not fire, but the UserControl_Initialize's do.
Why? Because VB is ending the program, and doing so it enters in a unwanted state and it "tries to do its best" (that many times is not good).
The mSubclassedControlsForPaintingHwnds collection was instantiated in the UserControl_Initialize event but it was already set to Nothing by VB before it raises the UserControl_Terminate event.
When shutting down, at the end VB sets to Nothing every object, but in an nondeterministic order.
OK; I added the protection to handle that situation (it is already on the Github repository).
Code:
Private Sub DoTerminate()
Dim c As Long
Dim iHwnd As Long
If mUserControlTerminated Then Exit Sub
mUserControlTerminated = True
tmrShowTabTTT.Enabled = False
Set mToolTipEx = Nothing
If (mFormHwnd <> 0) And mAmbientUserMode Then
On Error Resume Next
DetachMessage Me, mFormHwnd, WM_SYSCOLORCHANGE
DetachMessage Me, mFormHwnd, WM_THEMECHANGED
DetachMessage Me, mFormHwnd, WM_NCACTIVATE
DetachMessage Me, mFormHwnd, WM_GETDPISCALEDSIZE
On Error GoTo 0
End If
If mSubclassed Then
If mAmbientUserMode Then
On Error Resume Next
DetachMessage Me, mUserControlHwnd, WM_MOUSEACTIVATE
DetachMessage Me, mUserControlHwnd, WM_SETFOCUS
DetachMessage Me, mUserControlHwnd, WM_DRAW
DetachMessage Me, mUserControlHwnd, WM_INIT
DetachMessage Me, mUserControlHwnd, WM_SETCURSOR
On Error GoTo 0
mCanPostDrawMessage = False
Else
On Error Resume Next
DetachMessage Me, mUserControlHwnd, WM_LBUTTONDOWN
DetachMessage Me, mUserControlHwnd, WM_LBUTTONUP
DetachMessage Me, mUserControlHwnd, WM_LBUTTONDBLCLK
On Error GoTo 0
End If
End If
mSubclassed = False
tmrTabMouseLeave.Enabled = False
tmrDraw.Enabled = False
tmrCancelDoubleClick.Enabled = False
tmrCheckContainedControlsAdditionDesignTime.Enabled = False
tmrHighlightEffect.Enabled = False
Set mParentControlsTabStop = Nothing
Set mParentControlsUseMnemonic = Nothing
Set mContainedControlsThatAreContainers = Nothing
If Not mSubclassedControlsForPaintingHwnds Is Nothing Then
For c = 1 To mSubclassedControlsForPaintingHwnds.Count
iHwnd = mSubclassedControlsForPaintingHwnds(c)
On Error Resume Next
DetachMessage Me, iHwnd, WM_PAINT
DetachMessage Me, iHwnd, WM_MOVE
On Error GoTo 0
Next c
Set mSubclassedControlsForPaintingHwnds = Nothing
End If
If Not mSubclassedFramesHwnds Is Nothing Then
For c = 1 To mSubclassedFramesHwnds.Count
iHwnd = mSubclassedFramesHwnds(c)
On Error Resume Next
DetachMessage Me, iHwnd, WM_PRINTCLIENT
DetachMessage Me, iHwnd, WM_MOUSELEAVE
On Error GoTo 0
Next c
Set mSubclassedFramesHwnds = Nothing
End If
If Not mSubclassedControlsForMoveHwnds Is Nothing Then
For c = 1 To mSubclassedControlsForMoveHwnds.Count
iHwnd = mSubclassedControlsForMoveHwnds(c)
On Error Resume Next
DetachMessage Me, iHwnd, WM_WINDOWPOSCHANGING
On Error GoTo 0
Next c
Set mSubclassedControlsForMoveHwnds = Nothing
End If
If Not mTabIconFontsEventsHandler Is Nothing Then
mTabIconFontsEventsHandler.Release
Set mTabIconFontsEventsHandler = Nothing
End If
If mHandIconHandle <> 0 Then
DestroyCursor mHandIconHandle
mHandIconHandle = 0
End If
End Sub
-
Re: NewTab: tab control for VB6
In the Form_Initialize event, store the form hWnd into a variable, and use that at the form Terminate, not the form's property.
Code:
Private mFormhWnd As Long
Private Sub Form_Initialize()
mFormhWnd = Me.hWnd
End Sub
Private Sub Form_Terminate()
'
' Remove our subclassing so we can safely remove its related thunk.
RemoveWindowSubclass mFormhWnd, pMessageThunkPointer, mFormhWnd
-
Re: NewTab: tab control for VB6
Thanks Eduardo. And yeah, that Me.hWnd in the Terminate event was an oversight on my part.
Thanks for looking at it, and I'll store the hWnd as you suggest.
Again, this is FANTASTIC work on your part. :)
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
This is a really cool control! I downloaded it to try to use it in a project that needs some "refreshing". Of course, the first thing I try to do is to emulate the left hand side bar of Office 365 by rotating the Font Icons example in the test VB6 project.
I was wondering if I'm missing something, because the tabs rotated like they should, but the font rotated *with* the tabs (as they technically should), but now I want to rotate the fonts by 90 degrees so that they look like Office.
Is there a property to let me rotate the font on the tabs?
Thanks!!
-
Re: NewTab: tab control for VB6
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
BooksRUs
This is a really cool control! I downloaded it to try to use it in a project that needs some "refreshing". Of course, the first thing I try to do is to emulate the left hand side bar of Office 365 by rotating the Font Icons example in the test VB6 project.
I was wondering if I'm missing something, because the tabs rotated like they should, but the font rotated *with* the tabs (as they technically should), but now I want to rotate the fonts by 90 degrees so that they look like Office.
Is there a property to let me rotate the font on the tabs?
Thanks!!
Fixed the icons orientation. New version released.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
xiaoyao
I'm not sure, I think it was: Insert Image, From URL, not checked "Retrieve locally", and I set the URL of the image in GitHub.
-
Re: NewTab: tab control for VB6
I don't know how many megabytes of files the forum can upload at most.Is the total amount of personal use limited? I think there is only 10 megabytes of space.
Pictures will be compressed when they are uploaded, which is very embarrassing. It would be nice if there was a way to compress without blurring the picture at the time. If you directly use the link pictures of other websites and upload them in this way, it is estimated that they can be kept very clear.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
Fixed the icons orientation. New version released.
Super cool! Appreciate the quick response!
I was searching through documentation, etc. but can't seem to find the steps to replace an SSTAB control in an EXISTING project.
Can I add the NEWTAB control and then edit the .FRM file and change a few things to "slip install" the control in place of the old SSTAB?
Thanks again!
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
Fixed the icons orientation. New version released.
I downloaded and installed the newest version.
I believe I have found a "bug" in the control... when previewing/changing different Themes and applying them to the control, it appears that it is changing the ForeColor (and maybe BackColor too) of all controls INSIDE the tab containers. Once it does this, it doesn't automatically change them again, so that they can actually be seen.
For example, I had a plain SSTab, then changed to Sea Blue, and all labels, commandbuttons, and frames on the tab also changed to the Sea Blue text color. But, if I choose another Theme, then they don't change again.... very odd.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
BooksRUs
Super cool! Appreciate the quick response!
I was searching through documentation, etc. but can't seem to find the steps to replace an SSTAB control in an EXISTING project.
Can I add the NEWTAB control and then edit the .FRM file and change a few things to "slip install" the control in place of the old SSTAB?
Thanks again!
OK, I now added a ReadMe.txt file to the Docs folder.
with this text:
Quote:
Steps for replacing SSTab with NewTab in a project:
1 - Make a backup of your original project.
2 - Open the project in the IDE and from menu Project, Components, select NewTab for VB6, then click OK.
3 - Save the project and close the IDE.
4 - Not required but if you open the vbp file with Notepad now you should see this line:
Object={66E63055-5A66-4C79-9327-4BC077858695}#3.0#0; NewTab01.ocx
5 - Now you need to open with Notepad or other text editor each frm file and replace the text 'TabDlg.SSTab' with 'NewTabCtl.NewTab'
If you have many forms you can use a program to make a global text replace in all the *.frm files in a folder, I use TextRep available here:
https://no-nonsense-software.com/freeware
6 - Open the project in the IDE and go to menu Project, Components, and deselect Microsoft Tabbed Dialog Control 6.0, click OK.
7 - Save the project.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
BooksRUs
I downloaded and installed the newest version.
I believe I have found a "bug" in the control... when previewing/changing different Themes and applying them to the control, it appears that it is changing the ForeColor (and maybe BackColor too) of all controls INSIDE the tab containers. Once it does this, it doesn't automatically change them again, so that they can actually be seen.
For example, I had a plain SSTab, then changed to Sea Blue, and all labels, commandbuttons, and frames on the tab also changed to the Sea Blue text color.
This is on purpose, a feature, so you don't need to change every control color manually.
If you want, you can turn it of from the properties ChangeControlsForeColor and ChangeControlsBackColor
Quote:
Originally Posted by
BooksRUs
But, if I choose another Theme, then they don't change again.... very odd.
Fixed in the new release, thanks.
PS: the SSTab theme has these properties turned off, that that was the problem.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
This is on purpose, a feature, so you don't need to change every control color manually.
If you want, you can turn it of from the properties ChangeControlsForeColor and ChangeControlsBackColor
Fixed in the new release, thanks.
PS: the SSTab theme has these properties turned off, that that was the problem.
Great.. so it's a FEATURE, not a BUG... some of my programs have similar anomalies :D
Thanks for a cool control... slowly rolling it out.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
BooksRUs
Great.. so it's a FEATURE, not a BUG... some of my programs have similar anomalies :D
I don't consider it an anomaly, if you change the colors of a tab control, what would be expected is that you also will want to change the color of the controls that are inside.
It would look quite weird if you change the tab control background to blue and the labels remain with vbButtonFace.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
I don't consider it an anomaly, if you change the colors of a tab control, what would be expected is that you also will want to change the color of the controls that are inside.
It would look quite weird if you change the tab control background to blue and the labels remain with vbButtonFace.
Got it!
I have been playing around with this for a while trying to get it to integrate into my existing project. I have noticed that the following controls don't appear to change when the Theme is changed:
1. Labels that are Indexed, non-indexed labels seem to change
2. Textboxes
3. Commandbuttons
Thanks!
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
BooksRUs
Got it!
I have been playing around with this for a while trying to get it to integrate into my existing project. I have noticed that the following controls don't appear to change when the Theme is changed:
1. Labels that are Indexed, non-indexed labels seem to change
2. Textboxes
3. Commandbuttons
Thanks!
Hello,
Labels that are indexed do change. In some situations you need to let the control redraw after you paste them.
The control adapts the BackColor and ForeColor of controls that their BackColor and ForeColor match the colors of the tab control (usually they are also of the form).
TextBoxes and CommandButtons use another colors, generally (and by default).
Note: VB's normal CommandButton (without graphical style) can't be changed anyway.
BTW: I fixed a small bug and issued an update.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
OK, I now added a ReadMe.txt file to the Docs folder.
with this text:
So, I followed these instructions on a particular project and now I'm having some issues with the form. I can see and design the form. I can also compile the project, but if I run it in the IDE *or* the compiled program, when I load the form it all blows up (both in the IDE or the EXE).
Is there a way to debug the control with my project to see if I can figure out what's going on? Perhaps there's an issue with multiple tab SSTab being converted this way into a NewTab? I do recall that SSTab does a weird thing and moves everything ON each tab to .Left=-70000 and just redraws the tabs.
Just trying to figure it out. Let me know if there's anything I can try.
Thanks!
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
BooksRUs
Is there a way to debug the control with my project to see if I can figure out what's going on? Perhaps there's an issue with multiple tab SSTab being converted this way into a NewTab? I do recall that SSTab does a weird thing and moves everything ON each tab to .Left=-70000 and just redraws the tabs.
Just trying to figure it out. Let me know if there's anything I can try.
Thanks!
Hello. Yes, download the NewTab project from GitHub. If you have it already downloaded ensure that it is the latest version (updated on 2023-05-19)
Then open your project, add the NewTab project to the IDE from menu File, Add project, navigate to the NewTab project folder, and add from the "control-source" folder NewTabCtl.vbp
(I'm getting in my IDE an "Out of memory" error at this point, but just ignore it)
Then (do not forget these steps too) in the the NewTabCtl project, under User Controls, open the code form NewTab. Press Control+End to go to the last lines of the code, and in the line:
Code:
#Const COMPILE_WITH_TAB_PROPERTY = 0
change th 0 to 1:
Code:
#Const COMPILE_WITH_TAB_PROPERTY = 1
Now go to the Project menu, at the end select NewTab properties.
Click on the "Components" tab.
Select "Binary Compatibility".
Press OK.
Save the project group.
Now the NewTab control is executing from code.
You can place break points, but since it is subclassed the IDE might have disabled code windows or even crash if you modify some code in some situations.
-
Re: NewTab: tab control for VB6
[QUOTE=Eduardo-;5607382]
Code:
#Const COMPILE_WITH_TAB_PROPERTY = 0
change the 0 to 1:
Code:
#Const COMPILE_WITH_TAB_PROPERTY = 1
While doing this, I read the comments above this area:
Code:
'Tab is a reserved keyword in VB6, but you can remove that restriction.
'To be able to compile with Tab property, you need to replace VBA6.DLL with this version: https://github.com/EduardoVB/NewTab/raw/main/control-source/lib/VBA6.DLL
'VBA6.DLL is in VS6's installation folder, usually:
'C:\Program Files (x86)\Microsoft Visual Studio\VB98\
So, I did this and I have not been having as many problems as I was before... my question is:
Do I have to distribute this modified VBA6.DLL to all of my users?
Everything looks and runs great in the IDE, but when I run the compiled EXE, the program immediately dies (even on the dev machine)! I need to figure out how to deploy this! Please help!
Thanks!
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
BooksRUs
my question is:
Do I have to distribute this modified VBA6.DLL to all of my users?
No, you need only the modified DLL in your VB6 installation, for being able to compile using that reserved word.
The DLL is exactly the same as the original, the only difference is that 'Tab' is no longer a reserved keyword.
Quote:
Originally Posted by
BooksRUs
Everything looks and runs great in the IDE, but when I run the compiled EXE, the program immediately dies (even on the dev machine)! I need to figure out how to deploy this! Please help!
Thanks!
It must be something else.
-
Re: NewTab: tab control for VB6
BTW: the DLL is for SP6, ensure that you have SP6 installed first.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
It must be something else.
I have tried to figure this out on my own, but to no avail.
I ran ProcMon to possibly see what's happening. When the compiled EXE and VB6 fail, just before there is this line in the
Operation: RegOpenKey
Path: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\LanguagePack\SurrogateFallback\Segoe MDL2 Assets
Result: NAME NOT FOUND
After this it runs WerFault.exe and dies...
Perhaps there is something weird going on with the Segoe fonts that the control uses? Or something with Unicode? I have no idea, just throwing out ideas.
I hate to go backwards and have to use SSTab again, but I need to be able to get this to the users.
Thanks for your help!
-
Re: NewTab: tab control for VB6
What Windows version are you using?
I guess it must be a problem when compiling the control on Windows7/8.
Unfortunately, I have only Windows 11 here now to be able to test that.
But then, it has nothing to do with the replacement VBA6,DLL... I guess.
Do you have SP6 installed?
-
Re: NewTab: tab control for VB6
Wow. Incredibly impressive project Eduardo!
The documentation is equally impressive. Are you using a program to aid you produce documentation?
-
Re: NewTab: tab control for VB6
-
Re: NewTab: tab control for VB6
Dear Eduardo,
Thank you once again for this pleasing and wonderful control.
In order to use the NewTab control embedded in a project (instead of as an ocx), I just adopted the following simple methodology in a new sample project (say, 'abc'):
1. I created a new folder copying the following '6 directories' alone from your "control-source" folder.
- bas
- cls
- ctl
- frm
- pag
- subclass
2. Then, I added all the files in the above folders into my sample 'abc' project. In the case of two files alone (pagNewTabTabs.pag AND pagNewTabThemes.pag), I had to first replace 'NewTabCtl' with 'abc' inside them, before including them in my project.
Note: 'pagNewTabHelp.pgx' also has the word 'NewTabCtl' contained in it. I did not replace it though.
3. Now, I added one NewTab in 'Form1', started 'abc' from the IDE and it worked.
4. I created 'abc.exe' and executing it worked too, displaying the tabs in the starting screen.
5. I copy/pasted and just ran 'abc.exe' in one other occasionally used Windows10 system of mine and it worked therein too, displaying the tabs in the starting screen.
So, I believe all that is required to make your splendid 'NewTab' working embedded in a new project is, what I have done above. If I have missed any step or need to do anything more, please do let me know, when your time permits, since I am planning to use the same procedure as above, soon, to avail your NewTab in a larger project of mine, distributed to users.
Thanks a TON once again for this fantastic and beautiful control.
Kind Regards.
Edit-1: Changed 'pagNewTabHelp' to 'pagNewTabHelp.pgx'
Edit-2: Changed '7 directories' to '6 directories'
-
Re: NewTab: tab control for VB6
Hello, I don't think you missed any step.
-
Re: NewTab: tab control for VB6
Dear Eduardo,
Some issues observed:
Issue of primary concern to me right now
--
1. After starting your sample project group "Test uncompiled.vbg", in IDE (design time), I am unable to select the individual tabs (other than 'Tab 0') and place/add controls in them. To ensure it is so, I tried running your sample in the one other system of mine too. The result is the same. Of course, the result is the same, if I create a project of my own too (like 'abc', using the steps I mentioned in my previous post and which you have okayed).
Note-1: if I start "Test with ocx compiled.vbg", therein I am able to quite easily select all the individual tabs and place/add controls in them at design time.
Note-2: By 'Tab 0', I mean the tab with caption 'Tab 0' which appears selected by default anyway, as soon a NewTab is added to a form.
--
Issues NOT of primary concern
--
1. When using "Test uncompiled.vbg", after right-clicking the NewTab control (added to a form), clicking 'Properties' and selecting the 'Help' tab in the "Property Pages" screen, the 'Help' contents do not appear coherently. Also, the contents do not seem to get loaded fully.
2. Unicode texts (both caption and tooltip) not retained after close & reopen of project. All characters appear as questions marks. This issue exists in both 'Test uncompiled.vbg" and "Test with ocx compiled.vbg". If the project is compiled to an exe (with the Unicode texts), the executable exhibits Unicode text correctly for both caption and tooltip. So, right now, I am planning to manage this issue by populating the Unicode caption and tooltip texts during 'Form' Load. Any other easier way?
--
In case my above observations are incorrect, kindly let me know what I need to do to correct the issues I am facing.
General query:
To change the names of the themes, the procedure to be followed is to change their names in the bas file (mNewTabThemes). Right? I saw a theme named as 'Esmerald'. I wanted to change its name (name alone) to 'Emerald'. So, I changed "Esmerald" to "Emerald" in the 'LoadDefaultThemes' function of the aforesaid bas file. This works and I am able to see the change in the theme name effected correctly. But, hope this procedure I adopted is correct and there are no side-issues in this.
By the way, the facility to reorder the tabs at run time is great. Kudos for thinking of a feature like this in the first place.
And, I take this opportunity to once again thank you for your fabulous NewTab control.
Kind Regards.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
softv
Dear Eduardo,
Some issues observed:
Issue of primary concern to me right now
--
1. After starting your sample project group "Test uncompiled.vbg", in IDE (design time), I am unable to select the individual tabs (other than 'Tab 0') and place/add controls in them. To ensure it is so, I tried running your sample in the one other system of mine too. The result is the same. Of course, the result is the same, if I create a project of my own too (like 'abc', using the steps I mentioned in my previous post and which you have okayed).
Note-1: if I start "Test with ocx compiled.vbg", therein I am able to quite easily select all the individual tabs and place/add controls in them at design time.
Note-2: By 'Tab 0', I mean the tab with caption 'Tab 0' which appears selected by default anyway, as soon a NewTab is added to a form.
It is a protection, so it does not crash when running uncompiled in the IDE.
You can remove it. Close the form, then open the NewTab's UserControl code window, then go to the fist line and change it to:
Code:
#Const NOSUBCLASSINIDE = 0
Quote:
Originally Posted by
softv
Issues NOT of primary concern
--
1. When using "Test uncompiled.vbg", after right-clicking the NewTab control (added to a form), clicking 'Properties' and selecting the 'Help' tab in the "Property Pages" screen, the 'Help' contents do not appear coherently. Also, the contents do not seem to get loaded fully.
Could not reproduce this one, I see the text OK here.
Quote:
Originally Posted by
softv
2. Unicode texts (both caption and tooltip) not retained after close & reopen of project. All characters appear as questions marks. This issue exists in both 'Test uncompiled.vbg" and "Test with ocx compiled.vbg". If the project is compiled to an exe (with the Unicode texts), the executable exhibits Unicode text correctly for both caption and tooltip. So, right now, I am planning to manage this issue by populating the Unicode caption and tooltip texts during 'Form' Load. Any other easier way?
That's normal, The VB6 IDE cannot handle Unicode.
Yes, assign the texts in the Form_Load,
Quote:
Originally Posted by
softv
General query:
To change the names of the themes, the procedure to be followed is to change their names in the bas file (mNewTabThemes). Right? I saw a theme named as 'Esmerald'. I wanted to change its name (name alone) to 'Emerald'. So, I changed "Esmerald" to "Emerald" in the 'LoadDefaultThemes' function of the aforesaid bas file. This works and I am able to see the change in the theme name effected correctly. But, hope this procedure I adopted is correct and there are no side-issues in this.
No, it is OK.
Quote:
Originally Posted by
softv
By the way, the facility to reorder the tabs at run time is great. Kudos for thinking of a feature like this in the first place.
And, I take this opportunity to once again thank you for your fabulous NewTab control.
Kind Regards.
Thank you :thumb::thumb:
-
Re: NewTab: tab control for VB6
Thanks a TON, as always, Eduardo.
By the way, a label control (both intrinsic and krool's) placed inside a NewTab's tab does not display its tooltip text. The label displays it's tooltip text only if I enclose it inside a picturebox or frame control. Lack of hWnd for a label is the cause?
Well, if my above observation is correct, is there any easier way (than enclosing it inside a picturebox/frame) by which I can have the tooltip text of a label get displayed?
Kind Regards.
-
1 Attachment(s)
Re: NewTab: tab control for VB6
There seems to be a VB6 bug regarding that.
A Windowless UserControl placed inside a ControlContainer UserControl does not display the ToolTipText.
I don't think there is much we can do about that. (test project attached)
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
There seems to be a VB6 bug regarding that.
A Windowless UserControl placed inside a ControlContainer UserControl does not display the ToolTipText.
I don't think there is much we can do about that. (test project attached)
Yes, I thought something of that sort could be the case. Thanks.
Okay then, I will add a top-level picturebox/frame whenever a tab has one or more labels in it.
By the way, I observe that the tooltips of individual tabs get displayed (on mouseover) at runtime only, not at design time. If my observation is correct, is it possible to make the tabs' tooltips visible at design-time too, on mouseover?
Kind Regards.
-
Re: NewTab: tab control for VB6
OK, I updated the project and the ocx.
TabToolTipText now work at design time too and changed theme name Esmerald to Emerald.
-
Re: NewTab: tab control for VB6
Thanks a LOT, Eduardo, for the recent update.
By the way, as informed by you in post #20, I am sharing a new theme hereunder. :). I included it in my code and just termed it as 'Apple Green'. :)
--
BackColorTabSel=16514553|BackColorTabs=15136990|FlatBarColorHighlight=3633716|FlatBarColorInactive=1 4150350|FlatBarColorTabSel=1820177|FlatBorderColor=1820177|FlatBorderMode=1|ForeColorHighlighted=167 77215|HighlightColor=3633716|HighlightEffect=0|HighlightMode=68|HighlightModeTabSel=90|IconColorTabH ighlighted=16777215|Style=3
--
The facility to so easily create new themes and also share them as easily as above is too good. Thanks a TON.
Just one query though:
'Ambient Colors' checkbox - I am unable to notice any difference in color(s) anywhere, whether it is checked or unchecked. So, I am unable to know what it actually does.
Kind Regards.
-
1 Attachment(s)
Re: NewTab: tab control for VB6
Update released.
Quote:
Originally Posted by
softv
Thanks a LOT, Eduardo, for the recent update.
By the way, as informed by you in post
#20, I am sharing a
new theme hereunder. :). I included it in my code and just termed it as '
Apple Green'. :)
--
BackColorTabSel=16514553|BackColorTabs=15136990|FlatBarColorHighlight=3633716|FlatBarColorInactive=1 4150350|FlatBarColorTabSel=1820177|FlatBorderColor=1820177|FlatBorderMode=1|ForeColorHighlighted=167 77215|HighlightColor=3633716|HighlightEffect=0|HighlightMode=68|HighlightModeTabSel=90|IconColorTabH ighlighted=16777215|Style=3
--
The
facility to so easily create new themes and also share them as easily as above is
too good. Thanks a TON.
Thank you! I added "Apple Green" to the default themes (it is already in the new update).
Attachment 188756
Quote:
Originally Posted by
softv
Just one query though:
'Ambient Colors' checkbox - I am unable to notice any difference in color(s) anywhere, whether it is checked or unchecked. So, I am unable to know what it actually does.
Kind Regards.
That is if you want to change colors that are ambient colors (or not), like vbButtonFace and vbButtonText that are the default ambient colors, or the current ambient colors in case they were changed.
If you want to adjust the other colors but not to modify these ambient colors, then the checkbox need to be not checked (is the default).
If you want to modify them anyway, then check it.
It only has effect if the theme has ambient colors in the definition.
-
Re: NewTab: tab control for VB6
Hello Eduardo,
is it possible to create a manifest file for the OCX?
Thanks in advance.
-
Re: NewTab: tab control for VB6
Copy this code in the manifest:
Code:
<file name="NewTab01.ocx">
<typelib tlbid="{66E63055-5A66-4C79-9327-4BC077858695}" version="3.1" flags="control" helpdir="" />
<comClass clsid="{6C9D299A-B6CC-40B8-A155-4D3F154F6584}" tlbid="{66E63055-5A66-4C79-9327-4BC077858695}" threadingModel="Apartment" progid="NewTabCtl.NewTab" miscStatusIcon="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,simpleframe,setclientsitefirst" description="Tabbed control for VB6." />
</file>
I now have included this information in the ReadMe file.
-
Re: NewTab: tab control for VB6
Hi Eduardo,
Great work again! I've been using the SSTabEx with great satisfaction, and just when I was looking for some capabilities that I didn't have the need for before, I discovered this new tab, which offered exactly what I was looking for. ;-)
However, I'm now running into a little challenge:
On a form I have a tab control with multiple tabs. One of the tabs has several controls on it, among others a listview. The listview is populated when the tab is selected, with a progressbar giving the user feedback on the progress.
I’ve been using the click event to initiate the population of the listview, but that results in an “unresponsive” feeling. I.e. the tab is only selected (text bold), and the controls are only displayed at the end of the event, so there is no feedback to the user. It feels like the system if frozen until the listview has been populated.
DoEvents and Refresh don't make a difference, which I guess is logic. And as far as I can see there are no “post-click” / “activate” events.
What is the best way to quickly display the tab with its controls, and once that’s done, start populating the listview?
Thanks,
Erwin