Page 1 of 5 1234 ... LastLast
Results 1 to 40 of 161

Thread: NewTab: tab control for VB6

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    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.






    Download from GitHub.

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

    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}#8.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 at once, I use TextRep available here.
    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.


    Code for the manifest file to make a SxS installation:

    Code:
      <file name="NewTab01.ocx">
        <typelib tlbid="{66E63055-5A66-4C79-9327-4BC077858695}" version="8.0" 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>

  3. #3
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: NewTab: tab control for VB6

    Very good work Eduardo, an excellent final result
    leandroascierto.com Visual Basic 6 projects

  4. #4
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    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.
    Last edited by SearchingDataOnly; Nov 11th, 2022 at 06:10 AM.

  5. #5
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    497

    Re: NewTab: tab control for VB6

    Very good work.
    I've used STabEx a lot and this one looks much better.

  6. #6
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,253

    Re: NewTab: tab control for VB6

    Quote Originally Posted by SearchingDataOnly View Post
    @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)
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  7. #7
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    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

  8. #8
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,421

    Re: NewTab: tab control for VB6

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

  9. #9
    New Member
    Join Date
    Feb 2014
    Posts
    5

    Re: NewTab: tab control for VB6

    Excellent control, thanks for sharing

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

    Thanks for all the comments .

    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.

  11. #11
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    218

    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.

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

    Hello softv. No, the tooltips are not Unicode currently but I'll keep in mind the request.

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    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.

  14. #14
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    218

    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.

  15. #15

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

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

  16. #16
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    218

    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.

  17. #17

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

    Thanks, something like that I was talking about when I said "something simple".

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

  18. #18

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

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

  19. #19
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    218

    Re: NewTab: tab control for VB6

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

  20. #20

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    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:

    Name:  Share_theme.png
Views: 2845
Size:  27.7 KB

    Then post it here.
    (Everybody is invited.)

  21. #21
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,612

    Re: NewTab: tab control for VB6

    Name:  EduardoTab.jpg
Views: 2604
Size:  30.8 KB

    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.
    Attached Files Attached Files
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  22. #22
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,612

    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.
    Last edited by Elroy; Dec 21st, 2022 at 01:30 PM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  23. #23

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Elroy View Post
    Name:  EduardoTab.jpg
Views: 2604
Size:  30.8 KB

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

  24. #24

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    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

  25. #25
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,612

    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.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  26. #26
    Member
    Join Date
    Mar 2022
    Posts
    34

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post

    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!!

  27. #27
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,725

    Re: NewTab: tab control for VB6


  28. #28

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

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

  29. #29

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

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

  30. #30
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,725

    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.

  31. #31
    Member
    Join Date
    Mar 2022
    Posts
    34

    Re: NewTab: tab control for VB6

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

  32. #32
    Member
    Join Date
    Mar 2022
    Posts
    34

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    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.
    Last edited by BooksRUs; Apr 26th, 2023 at 10:59 AM.

  33. #33

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

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

    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.

  34. #34

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

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

  35. #35
    Member
    Join Date
    Mar 2022
    Posts
    34

    Re: NewTab: tab control for VB6

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

    Thanks for a cool control... slowly rolling it out.

  36. #36

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

    Quote Originally Posted by BooksRUs View Post
    Great.. so it's a FEATURE, not a BUG... some of my programs have similar anomalies
    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.

  37. #37
    Member
    Join Date
    Mar 2022
    Posts
    34

    Re: NewTab: tab control for VB6

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

  38. #38

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

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

  39. #39
    Member
    Join Date
    Mar 2022
    Posts
    34

    Re: NewTab: tab control for VB6

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

  40. #40

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,958

    Re: NewTab: tab control for VB6

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

Page 1 of 5 1234 ... 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