When the CaptionBar position is at the bottom (ssTabOrientationBottom), it seems like the text and icons don't look good.
Yes you're right. I mean the position of the text and icons is too low. I'm looking for a property to make text and icons vertically centered on the CaptionBar. But I don't know which properties I should set to make it look like figure B.
1) Close the IDE.
2) Run "NewTab01 Unregister (run as Admin).bat" file as admin to unregister the old version of the ocx.
3) Download the new version.
4) Run "NewTab01 Register (run as Admin).bat" as admin to register the new version.
5) Open the IDE as admin, at least the first time.
I have tested the updated version. I see that the appearance of the CaptionBar has changed slightly, but it is not proportional enough (figure A). But that's okay, because I can use tabs with the FlatBar style enabled (figure B), or by changing the value of the TabHeight property (figure C).
1 — In this last NewTab control, for the vertical position of the text or image on the CaptionBar, it looks good for the CaptionBar position at the bottom (ssTabOrientationBottom). However, for the CaptionBar position at the top (ssTabOrientationTop), it seems it's still not centered enough.
2 — When I select the Silver style tab, with the FlatBarHeight property value = 3 and with the CaptionBar position at the bottom (ssTabOrientationBottom), the FlatBar does not appear.
I actually want to be able to set the vertical position of the text and image in the middle of the CaptionBar, for the top (ssTabOrientationTop) or the bottom (ssTabOrientationBottom) CaptionBar. But for now, I think I can use the settings as in my post #125 above.
I'll study what you say, but as a first look I measured the first tab control (the top-left in the form) and I see that the tab captions are vertically centered.
Here I tested it at 125% DPI, it might be a difference of 1 pixel at other DPI setting due to rounding.
I'm talking about the non-active tabs, 7 pixels up and 7 pixels down. 👇
About the icons positions, you also can use the IconTopOffset property.
That value is per tab (per icon).
Originally Posted by NA70
2 — When I select the Silver style tab, with the FlatBarHeight property value = 3 and with the CaptionBar position at the bottom (ssTabOrientationBottom), the FlatBar does not appear.
That was a bug, that I found and fixed it, thanks.
I still didn't post the update because I'm waiting to see if I change something else.
Last edited by Eduardo-; Dec 15th, 2023 at 07:26 PM.
I heartily wish you a Very Happy New Year, Eduardo.
Your NewTab control is one of the most aesthetically purposeful controls, in my personal humble opinion. Thanks a TON, ever.
I have not had time to check out the recent enhancements (esp. the very exciting 'TabForm' feature) in NewTab. As soon as I do, I will write back here.
Have a Divineful Year!
God Bless you. God Bless all.
Kind Regards.
Love is God. God is Love. As Ever, All Glory and Thanks to the Lord Almighty Only, Forever...
"You say grace before meals. All right. But I say grace before the concert and the opera, and grace before the play and pantomime, and grace before I open a book, and grace before sketching, painting, swimming, fencing, boxing, walking, playing, dancing and grace before I dip the pen in the ink." - G. K. Chesterton
I heartily wish you a Very Happy New Year, Eduardo.
Your NewTab control is one of the most aesthetically purposeful controls, in my personal humble opinion. Thanks a TON, ever.
I have not had time to check out the recent enhancements (esp. the very exciting 'TabForm' feature) in NewTab. As soon as I do, I will write back here.
Have a Divineful Year!
God Bless you. God Bless all.
Kind Regards.
Thank you softv! Happy new year and God bless you!
Hello. There is no tracking of what was the original index of tabs, then you need to do it yourself:
Code:
Private Sub Form_Load()
Dim c As Long
NewTab1.CanReorderTabs = True
For c = 0 To NewTab1.Tabs - 1
NewTab1.TabData(c) = c
Next
End Sub
Private Sub Command1_Click()
Dim c As Long
' set focus to 'Tab 2'
For c = 0 To NewTab1.Tabs - 1
If NewTab1.TabData(c) = 2 Then
NewTab1.Tab = c
Exit For
End If
Next
End Sub
2024-01-13 Changed to OLE version 7.0.
2024-01-13 Added SetActiveTab method.
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.
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.
2024-01-13 TabSel property is hidden now, it is kept for compatibility but is deprecated. Use the Tab property instead.
Last edited by Eduardo-; Feb 3rd, 2024 at 02:05 AM.
Excellent work! There's all kinds of improvements in this version:
It seems impervious to DPI scaling issues, and it should be much easier to locate the tab after a user has changed the order!
Thanks bro!
Edit: Forgot to mention the improvement of data types from integer to long. Doesn't matter so much on modern machines, but longs are considerably better peformance-wise compiled.
Last edited by taishan; Jan 14th, 2024 at 05:11 PM.
Good morning,
I'm trying to use this excellent library in one of my VB6 projects to be able to use tabs containing Forms.
Unfortunately at the moment I have some problems because by clicking on a button in the home tab the form that should open in a new tab instead opens as a normal non-modal window.
I'm probably doing something wrong but I can't figure out what.
Anyone have suggestions?
Thank you
Good morning,
I'm trying to use this excellent library in one of my VB6 projects to be able to use tabs containing Forms.
Unfortunately at the moment I have some problems because by clicking on a button in the home tab the form that should open in a new tab instead opens as a normal non-modal window.
I'm probably doing something wrong but I can't figure out what.
Anyone have suggestions?
Thank you
I assume that you are using it in TDIMode = ntTDIModeForms
Well, the possible cause is that the BorderStyle of the Form is Fixed ToolWindow, Sizable ToolWindow or None.
I assume that you are using it in TDIMode = ntTDIModeForms
Well, the possible cause is that the BorderStyle of the Form is Fixed ToolWindow, Sizable ToolWindow or None.
Hi Eduardo, thanks for reply. I confirm you that the properties are ok.
When I start my application the new tab inserted works correctly and by clicking on a specific button the associated form opens as a tab, but then if I act on other parts of the application and then click on the button again, the form no longer opened in tab but as a normal form.
It appears as if the newtab object loses focus and no longer handles the form in the tab
Hi Eduardo, thanks for reply. I confirm you that the properties are ok.
When I start my application the new tab inserted works correctly and by clicking on a specific button the associated form opens as a tab, but then if I act on other parts of the application and then click on the button again, the form no longer opened in tab but as a normal form.
It appears as if the newtab object loses focus and no longer handles the form in the tab
Yes, please post a sample project where we can reproduce what is happening.
Hi Eduardo, thanks for reply. I confirm you that the properties are ok.
You have no idea how many times people have made claims like that and they turned out to be false. You need to show us what you're actually doing. It's not always necessary but the best way for us to diagnose the issue is to do what you're doing and see what you're seeing. Assume that that is always necessary and ALWAYS provide all the relevant information. It's not always completely obvious what's relevant but anything required to reproduce the issue should be assumed to be so. If we have to keep asking for more, it's just more time that you can't fix the issue and get on with your project.
Private Sub NewTab1_TDIBeforeNewTab(ByVal TabType As NewTabCtl.NTTDINewTabTypeConstants, ByVal TabNumber As Long, TabCaption As String, LoadControls As Boolean, Cancel As Boolean)
If TabCaption = "Form4" Then
Cancel = True
End If
End Sub
--------------------------------------
Hello Eduardo!
This function (TabCaption = "Form4") can you change Caption to "FormName", for example: (TabName = "Form4") or (TabName = Form.Name). Because the form title may change (e.g., a multilingual version of the form) and the form name does not change, it makes more sense to use the form name.
Thank you very much!
Private Sub NewTab1_TDIBeforeNewTab(ByVal TabType As NewTabCtl.NTTDINewTabTypeConstants, ByVal TabNumber As Long, TabCaption As String, LoadControls As Boolean, Cancel As Boolean)
If TabCaption = "Form4" Then
Cancel = True
End If
End Sub
--------------------------------------
Hello Eduardo!
This function (TabCaption = "Form4") can you change Caption to "FormName", for example: (TabName = "Form4") or (TabName = Form.Name). Because the form title may change (e.g., a multilingual version of the form) and the form name does not change, it makes more sense to use the form name.
Thank you very much!
Hello. The NewTab component don't have access to forms names of the client program. The other option besides form's caption would be the hWnd.
Anyway, while the form's caption could change, you should know its caption, since it is at the time the form is showing (.Show).
Or, you could store its caption in an auxiliary variable, change to another caption, for example to the form's name, and after the form was shown change it back to the original caption.
Because I don't see a way to get the forms names from the OCX program. Forms are just windows from there.
Last edited by Eduardo-; Feb 3rd, 2024 at 11:22 AM.
Hello everybody. I'm thinking in renaming the event TabBodyResize to just Resize.
There is currently a Resize event that IMO is quite useless, so that would be removed and replaced.
But, I guess that some may be using that event (TabBodyResize), so they would have to change its name in the source code.
What do you think?
OK, I went ahead and changed the TabBodyResize event name to Resize. And TabBody[Left|Top|Width|Height] property names to Body[Left|Top|Width|Height].
2024-02-03 Changed to OLE version 8.0.
2024-02-03 Changed property names TabBody[Left|Top|Width|Height] property names to Body[Left|Top|Width|Height].
2024-02-03 Changed TabBodyResize event name to Resize.
2024-02-03 Background of LabelW now is painted the same as Label when the Windows visual style is active.
2024-02-03 Several minor bug fixes related to themes.