Page 4 of 6 FirstFirst 123456 LastLast
Results 121 to 160 of 229

Thread: NewTab: tab control for VB6

  1. #121
    New Member
    Join Date
    Sep 2023
    Posts
    7

    Re: NewTab: tab control for VB6

    Thank you for your attention. I'll try again to upload the images I meant. Hopefully there are no problems.

    1 - Place the text/icon in the middle of the CaptionBar.

    Name:  ask-vbforums-01B.jpg
Views: 706
Size:  21.4 KB

    2 - Text/icon display when CaptionBar is at the bottom.

    Name:  ask-vbforums-03.jpg
Views: 695
Size:  13.4 KB

    3 - Custom CaptionBar shape.

    Name:  ask-vbforums-04.png
Views: 699
Size:  5.7 KB

    I apologize because I have to repeat several times to upload the images I intended.

  2. #122

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Quote Originally Posted by NA70 View Post
    1 - How do I arrange the text and icon to be in the middle of the CaptionBar (adjusting to the size of the CaptionBar)?
    The captions are centered without doing anything.
    These properties influence the size of the tabs:

    TabWidthStyle
    TabMinWidth
    TabMaxWidth

    This property defines the position of the icon:

    IconAlignment

    The size of the icon: IconFont
    IconFont is for each tab, each tab can have a different icon font.

    Size of caption font: Font
    This property affects all the tabs, all the captions have the same font.

    Quote Originally Posted by NA70 View Post
    When the CaptionBar position is at the bottom (ssTabOrientationBottom), it seems like the text and icons don't look good.
    What do you mean specifically ("don't look good")? The captions and icons are too low? something else?

    Quote Originally Posted by NA70 View Post
    2 - Is it possible to display custom tab shapes like image attachments?
    It does not have those diagonal or cut tab borders.
    But it supports rounded borders.
    To see that, set Style: ntStyleFlat
    and play with FlatRoundnessTop / FlatRoundnessBottom

  3. #123
    New Member
    Join Date
    Sep 2023
    Posts
    7

    Re: NewTab: tab control for VB6

    Thank you for your answer and information.

    When the CaptionBar position is at the bottom (ssTabOrientationBottom), it seems like the text and icons don't look good.
    Name:  ask-vbforums-05.jpg
Views: 713
Size:  14.9 KB

    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.

  4. #124

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    I updated the files. Please test now.

    To install an update:

    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.

  5. #125
    New Member
    Join Date
    Sep 2023
    Posts
    7

    Re: NewTab: tab control for VB6

    Thank you Eduardo.

    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).

    Name:  ask-vbforums-06.jpg
Views: 675
Size:  18.4 KB

    Thank you for the help.

  6. #126

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    OK, I updated it again. I think now it must be OK.

  7. #127
    New Member
    Join Date
    Sep 2023
    Posts
    7

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    OK, I updated it again. I think now it must be OK.
    Thanks for your help...

  8. #128

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Quote Originally Posted by NA70 View Post
    Thanks for your help...
    Did you test the new?

  9. #129
    New Member
    Join Date
    Sep 2023
    Posts
    7

    Re: NewTab: tab control for VB6

    I've tested it.

    Name:  Capture-001.jpg
Views: 644
Size:  20.6 KB

    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.
    Attached Files Attached Files

  10. #130

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    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. 👇

    Name:  nt1.jpg
Views: 632
Size:  5.7 KB

    About the icons positions, you also can use the IconTopOffset property.
    That value is per tab (per icon).

    Quote Originally Posted by NA70 View Post
    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.

  11. #131

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Update released.

    I made some fixes related to tab-captions vertical position.
    Please test now and report.
    Thank you.

  12. #132
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    235

    Re: NewTab: tab control for VB6

    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

  13. #133

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Quote Originally Posted by softv View Post
    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!

  14. #134
    Addicted Member
    Join Date
    Feb 2022
    Posts
    189

    Re: NewTab: tab control for VB6

    Hi Eduardo, what's the best way to auto-select focus to a tab when the user has changed the tab order?
    Code:
    Tabs.CanReorderTabs = True
    '// for example: user changes tab 2 to position tab 4 
    Tabs.TabSel = 2
    '// how can we set focus to tab 2, but is now tab 4?
    Last edited by taishan; Jan 8th, 2024 at 07:19 PM.

  15. #135

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    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
    You can use TabData property or TabTag.

  16. #136
    Fanatic Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    621

    Re: NewTab: tab control for VB6

    Just downloaded and played around with the Sample project. This looks wonderful Eduardo! Thank you so much.

  17. #137

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Update released.

    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.

  18. #138
    Addicted Member
    Join Date
    Feb 2022
    Posts
    189

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    2024-01-13 Changed to OLE version 7.0.
    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.

  19. #139
    Addicted Member
    Join Date
    Feb 2022
    Posts
    189

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    Hi Eduardo, what's the best way to auto-select focus to a tab when the user has changed the tab order?
    Code:
    Tabs.CanReorderTabs = True
    '// for example: user changes tab 2 to position tab 4 
    Tabs.TabSel = 2
    '// how can we set focus to tab 2, but is now tab 4?
    Hi Eduardo, in light of your recent version, what is the most efficient way to do this task?

  20. #140

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    Hi Eduardo, in light of your recent version, what is the most efficient way to do this task?
    Code:
    NewTab1.SetActiveTab "Tab 2"
    or

    Code:
    NewTab1.SetActiveTab 2, ntFindOriginalIndex

  21. #141
    Addicted Member
    Join Date
    Feb 2022
    Posts
    189

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    Code:
    NewTab1.SetActiveTab "Tab 2"
    or
    Code:
    NewTab1.SetActiveTab 2, ntFindOriginalIndex
    Beautiful and elegant. Thank you!

  22. #142
    New Member
    Join Date
    Jan 2024
    Posts
    2

    Re: NewTab: tab control for VB6

    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

  23. #143
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,665

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Maxlife View Post
    I'm probably doing something wrong but I can't figure out what.
    How should we work out what you're doing wrong with no knowledge of what you're doing in the first place?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  24. #144

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Maxlife View Post
    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.

  25. #145
    New Member
    Join Date
    Jan 2024
    Posts
    2

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    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

  26. #146
    Hyperactive Member
    Join Date
    Jul 2022
    Posts
    347

    Re: NewTab: tab control for VB6

    Post your code so that others are able to give you feedback on why it is doing something other than you expect.

  27. #147

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Maxlife View Post
    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.

  28. #148
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,665

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Maxlife View Post
    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  29. #149
    Fanatic Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    535

    Re: NewTab: tab control for VB6

    Hello Eduardo, very good control.
    How can you change the width of a tab.
    I want to make the collapse effect.

    Something else could be done like in Chrome tab group would be great

  30. #150

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Hello. Currently the tab widths are automatic, depending on TabWidthStyle setting.
    There is no direct control over each tab width now.

  31. #151
    Fanatic Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    535

    Re: NewTab: tab control for VB6

    ok Thank

  32. #152

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Hello, update released:

    2024-02-01 Added property TabFixedWidth
    2024-02-01 Fixed bug when WordWrap = False
    2024-01-27 TabsPerRow is no longer considered a theme property.
    2024-01-20 Bug fix in built-in themes data.
    2024-01-19 Added GetThemeData / SetThemeData methods.
    2024-01-18 Added GetTabsOrder / SetTabsOrder methods (CanReorderTabs must be True).
    2024-01-18 Added FindTab method.

  33. #153

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    There is no direct control over each tab width now.
    @yokesee: now there is, the TabFixedWidth property.

    Name:  NewTab_Animation.gif
Views: 303
Size:  44.1 KB

    Attached is the example of animating a tab that you see in the image.
    Attached Files Attached Files

  34. #154
    Fanatic Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    535

    Re: NewTab: tab control for VB6

    Good job Eduardo you are great
    many thanks

  35. #155
    Addicted Member
    Join Date
    Feb 2022
    Posts
    189

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    ...Attached is the example of animating a tab that you see in the image.
    Excellent, I was looking for a fixed tab width property, and the animation looks really slick! Great work!

  36. #156
    Lively Member
    Join Date
    Oct 2014
    Posts
    106

    Re: NewTab: tab control for VB6

    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!

  37. #157

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Quote Originally Posted by smileyoufu View Post
    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.

  38. #158

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    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?

  39. #159

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,232

    Re: NewTab: tab control for VB6

    Update released.

    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.

  40. #160
    Lively Member
    Join Date
    Oct 2014
    Posts
    106

    Re: NewTab: tab control for VB6

    Hello Eduardo!
    Thank you for your prompt reply, I will continue to use the "Caption" method as you suggested.
    Thank you very much!

Page 4 of 6 FirstFirst 123456 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width