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

Thread: (VB6) SSTabEx: SSTab replacement. Themed and with new features

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Note: this control has been superseded by NewTab control and is no longer updated/maintained.

    This control is a direct replacement of the SSTab control.
    It fully replaces the SSTab control (TabCtl32.ocx), while adding more features.


    Download from GitHub
    .

    Read the help documentation online.

    Some enhancements are:

    • It supports Windows visual styles or themes
    • The background color of the tabs can be changed (property TabBackColor)
    • Another Style has been added (along with the two available in the original): it can be also rendered with the TabStrip look alike.
    • Several new events and properties available
    • More control at design time, for example the controls can be moved from one tab to another (that is available in a property page)
    • Since many properties that define the appearance can be customized, the customized values can be saved (from a property page) and restored into another SSTabEx control.
    • It fixes the focus to hidden controls issue that the original SSTab suffers when navigating with the tab key.


    Themed in Windows 10:
    Name:  SSTabExSampleW10.png
Views: 6096
Size:  8.9 KB

    Not themed but TabBackColor changed (and also Style = ssStyleTabStrip):
    Name:  SSTabEx2.JPG
Views: 8237
Size:  13.6 KB

    One note: if you use the Tab property of the control in code, you'll have to change it to TabSel.
    I couldn't use Tab as a property name because it is a VB6 reserved keyword.

    It should work in any Windows version from Windows 2000.
    (Not tested, just tested on XP SP3 and Windows 10).

    For documentation, there are two files:

    • docs/Readme - Notes.txt, and explains things related to the component development and compiling.
    • And docs/tabexctl_reference.html that is the control documentation, from the point of view of using the control. The same information is in a property page.



    Changelog:
    2022-06-28 Validation added: TabsPerRow property now doesn't accept 0 as a value.
    2022-06-27 Fix in Property Page "General". Some validations were missing and change behavior when a text field gets focused (.
    2022-06-26 Fix in CheckContainedControlsConsistency procedure.
    2022-06-26 Fixed errors when the control was used in VBA.
    2022-06-25 Behavior change: when an OLE element is dragged over an inactive tab, the drop is disabled.
    2022-06-25 Fixed: OLEDropMode property was not applying value changed at design time.
    2022-06-25 Removed dependency on vba6.dll for the compiled ocx.
    2022-06-19 Fixed bug introduced in 2022-08-06 fix
    2022-06-12 Fixed issue regarding gaps between tabs when control is themed and noticiable mostly when the backcolor is different to the tab color.
    2022-06-08 Improved compatibility with Krool's controls (fixed an issue with .hWnd of the controls).
    2021-11-30 Added ContainedControlMove method
    2021-11-28 fix in ContainedControlLeft property
    2021-11-16 important bug fix in TabVisible property
    2021-10-27 bug fix in TabVisible property when no visible tab is left, and after that a tab is made visible.
    2021-10-23 improvements regarding disabled state (Enabled = False).
    2021-07-02 fixed bug in tab appearance when TabSeparation > 0 and control is themed.
    2021-07-02 fixed bug in font when TabOrientation is set to bottom.
    2021-06-27 changed constant names in cDlg to avoid conflict with other components.
    2021-06-27 fixed bug related to tab border width when VisualStyles = False and Style = ssStyleTabbedDialog.
    2021-06-27 fixed bug related to tab background color glitch when VisualStyles = False, Style = ssStyleTabbedDialog, BackColor <> TabBackColor and mouse hovers over a tab being screen DPI = 100%.
    2021-05-06 Updated documentation
    2021-04-07 Added property AutoTabHeight.
    2021-04-07 The automatic tab width when Style is set to ssStyleTabStrip or when the control is themed and Style is ssStyleTabStrip or ssStylePropertyPage has been changed to add a little space between tabs.
    2021-04-06 Made some minor corrections to the interface with the help of VBCompareInterface and VBCopyInterface - https://www.vbforums.com/showthread.php?890861
    2021-04-06 Changed/reorganized folders and files locations.
    2021-04-06 Removed file subclass.cls (GSubclass class), and changed isubclass.cls to cIBSSubclass.cls, mSubclass.bas to mBSSubclass.bas and mPropsDB to mBSPropsDB (These files are all under the 'subclass' folder. Whatch that if you are updating from a previous version in an existing project).
    2021-04-06 Added IDE protection for the subclassing code when it runs in source code. It does not cover all and every situation, but most normal situations that can crash the IDE are covered, like when the UserControl goes into zombie state or start compiling with an instance of the control open at design time. This code doesn't get added to the compiled version (it is automatically excluded).
    2021-04-02 Changed the ToolBoxBitmap.

    [cut, full version in Changelog.txt inside]
    2018-02-06: Initial release

    Download from GitHub
    .
    Last edited by Eduardo-; Nov 10th, 2022 at 02:13 PM. Reason: new version

  2. #2
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Good work. A solid SSTab was overdue and now as you have done it I might stick to your version instead of the unflexible TabStrip.

    Just two advise upfront related to DPI awareness, since I trapped over all this.
    1. Don't use ScaleX to convert Himetric to pixels, it's not precise on some DPI settings. Instead use an API way. (Like I did via CHimetricToPixel_X/Y functions)
    2. In the UserControl_Resize handler you shall do a following to correct the sizes VB reports from the host:
    Code:
    With UserControl
    If DPICorrectionFactor() <> 1 Then
        .Extender.Move .Extender.Left + .ScaleX(1, vbPixels, vbContainerPosition), .Extender.Top + .ScaleY(1, vbPixels, vbContainerPosition)
        .Extender.Move .Extender.Left - .ScaleX(1, vbPixels, vbContainerPosition), .Extender.Top - .ScaleY(1, vbPixels, vbContainerPosition)
    End If
    End With

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by Krool View Post
    Good work. A solid SSTab was overdue and now as you have done it I might stick to your version instead of the unflexible TabStrip.

    Just two advise upfront related to DPI awareness, since I trapped over all this.
    1. Don't use ScaleX to convert Himetric to pixels, it's not precise on some DPI settings. Instead use an API way. (Like I did via CHimetricToPixel_X/Y functions)
    2. In the UserControl_Resize handler you shall do a following to correct the sizes VB reports from the host:
    Code:
    With UserControl
    If DPICorrectionFactor() <> 1 Then
        .Extender.Move .Extender.Left + .ScaleX(1, vbPixels, vbContainerPosition), .Extender.Top + .ScaleY(1, vbPixels, vbContainerPosition)
        .Extender.Move .Extender.Left - .ScaleX(1, vbPixels, vbContainerPosition), .Extender.Top - .ScaleY(1, vbPixels, vbContainerPosition)
    End If
    End With
    I found a problem when converting from/to vbContainerSize/vbContainerPosition. More info here.
    That's why I made four functions: FromContainerSizeY, FromContainerSizeX, ToContainerSizeY and ToContainerSizeX.
    They are just internal functions.

    I also found a problem related to units, and is that in the property window, when the ScaleMode of the container is changed, the properties that work with container coordinates, may show rounding errors. For example the TabHeight may show 400.0002.
    That doesn't happen in the original.
    I made a function FixRoundingError that fixes that.

    I don't know if those issues could be related to what you are pointing. I didn't realize of something related particulary with vbHimetric, but those problems perhaps has to do with it?

    I would like to know if you see that something is bahaving wrongly. Please provide steps to reproduce the problem.

    You said:
    Don't use ScaleX to convert Himetric to pixels, it's not precise on some DPI settings
    I tested mainly in 120 DPI that is what I normally use in my computer, and also at 96 DPI and 144 DPI (not too much, but it seemed to work OK in every DPI setting).

    What circumstances should I set up to see that problem?

    Thanks for your imput Krool.

  4. #4
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by Eduardo- View Post
    I tested mainly in 120 DPI that is what I normally use in my computer, and also at 96 DPI and 144 DPI (not too much, but it seemed to work OK in every DPI setting).

    What circumstances should I set up to see that problem?
    See post #9 in LaVolpe's Being DPI aware Tutorial:
    http://www.vbforums.com/showthread.p...=1#post5165851

    Edit: I'm aware of the Single > Long > Single (HIMETRIC) rounding issue with vbContainerSize/vbContainerPosition.
    I kind of live with that. Like the MSComCtl.ocx did the same as they didn't offer a ScaleMode property like you did now. As for msflexgrid.ocx I also stick hard-coded to vbTwips for my VBFlexGrid.
    Last edited by Krool; Feb 6th, 2018 at 08:59 AM.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by Krool View Post
    See post #9 in LaVolpe's Being DPI aware Tutorial:
    http://www.vbforums.com/showthread.p...=1#post5165851

    Edit: I'm aware of the Single > Long > Single (HIMETRIC) rounding issue with vbContainerSize/vbContainerPosition.
    I kind of live with that. Like the MSComCtl.ocx did the same as they didn't offer a ScaleMode property like you did now. As for msflexgrid.ocx I also stick hard-coded to vbTwips for my VBFlexGrid.
    Yes, but this issue is not just related to Himetric, it is also related to Twips.

    VB6 doesn't work properly at DPI's that 1440/DPI is a non integer, because it internally works with integers. Screen.TwipsPerPixelsX/Y also works with integers. It can work at 160 DPI, 180 DPI, but not at 192 DPI (200%) or 168 DPI (175%).
    Many things will work wrong in such DPI settings, not just this one.
    VB6 is not ready for that.

    DPI settings where a VB6 program can work fine are 96, 103, 111, 120, 131, 144, 160, 180, 206, 240, 288, 360, 480, 720 and 1440.
    (It is 1440 / DPI = Twips. The above are values that lead to integers and VB6 can handle)
    The ones in blue, may work, but should be tested each one because they have still a small rounding.

    The ones in bold, are the ones offered to easily set in Windows GUI, so are the ones the people use.
    It is also offered 192 DPI (200%) and I don't know if in some Windows version may be (168 DPI) 175%?

    VB6 will have multiple issues running in those DPI, not just this one.
    My programs explicitely check that and just show a message at startup saying that the program can't run at that DPI setting.

    There is no easy solution for that, just a VB update where it could use single precission values intead of integer for TwipsPerPixelsX/Y.

    Fortunatelly, people are not using -nowaday- those DPI setting (normally).

    Edit: In other words: if you want to handle that, you should not use ScaleX/Y(vbTwips/vbPixels, vbPixels/vbTwips) nor Screen.TwipsPerPixelsX/Y either.

  6. #6
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    I agree. However the UserControl_Resize *fix* is important. Because in atypical DPI we have some offsets which we can live with. However UserControls are even more off then what's set by the host (Form). So at least that's fixed even if overall there is something off, but that's a minor difference.

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by Krool View Post
    I agree. However the UserControl_Resize *fix* is important. Because in atypical DPI we have some offsets which we can live with. However UserControls are even more off then what's set by the host (Form). So at least that's fixed even if overall there is something off, but that's a minor difference.
    I'll study that at some point.
    Since I considered that VB6 is not ready to work at such DPI settings, because any mid-sized program will surely have many of those issues, I didn't pay attention to them.
    But still, if something could be fixed, it would be better.
    As I said, in my programs I show a message telling the user that the program won't display right in such DPI setting. So, it isn't a feature that for me personally would make a difference.
    But I'll still study it when I have more time, for the ones that make small programs that perhaps have only a few controls and could benefit from that fix (and that also have users with those -today's- quite strange DPI settings).

    Thanks Kroll, I'll do it when I finish other things that I'm currently working on.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Also, just in case that you would like to add it to your controls set, and make modifications (or not) or to add more features, feel free to do it.
    I'm releasing it as free software, or public domain like license, so there is no need to cite author or anything (*).

    I only would like (althoughit is not a condition or requirement), for you or anyone else, is that if you find bugs or problems, to report here, so I can also fix my own code.
    I'm already using it in my programs.

    Thanks.

    Edit: (*) but you can still do it if you want, to say people that you are not responsable of the bugs -that it could have- or the coding style if you don't like it.

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

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Nice work, Eduardo. This (along with Krool's work) gives me a path to completely dump OCX files if I ever decide to do the necessary testing.

    Take Care,
    Elroy
    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. To all, peace and happiness.

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    New release.
    Fixed bugs with controls that don't have Width property, or Left property can't be changed at run time.

    The changes are in Sub SetVisibleControls, Function MouseIsOverAContainedControl and Sub RearrangeContainedControlsPositions

    Fixed bug in HideAllContainedControls.

  11. #11

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Hello Krool,

    Quote Originally Posted by Krool View Post
    1. Don't use ScaleX to convert Himetric to pixels, it's not precise on some DPI settings. Instead use an API way. (Like I did via CHimetricToPixel_X/Y functions)
    I corrected that. It is an issue of converting to and from pixels (from/to any scale).
    I added two internal custom functions: pScaleX and pScaleY that do the conversion right.
    Also, I added two other functions: Screen_TwipsPerPixelsX and Screen_TwipsPerPixelsY for correcting those values, and two correction factors: mXCorrection and mYCorrection for correcting X and Y at Mouse_Move/Up/Down events.

    It seems to work fine at 192 DPI now.

    Quote Originally Posted by Krool View Post
    2. In the UserControl_Resize handler you shall do a following to correct the sizes VB reports from the host:
    Code:
    With UserControl
    If DPICorrectionFactor() <> 1 Then
        .Extender.Move .Extender.Left + .ScaleX(1, vbPixels, vbContainerPosition), .Extender.Top + .ScaleY(1, vbPixels, vbContainerPosition)
        .Extender.Move .Extender.Left - .ScaleX(1, vbPixels, vbContainerPosition), .Extender.Top - .ScaleY(1, vbPixels, vbContainerPosition)
    End If
    End With
    I still didn't study that...
    Thanks.

  12. #12
    New Member
    Join Date
    Jun 2018
    Posts
    5

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Hi Eduardo,

    really a nice job!

    I am testing SStabEx, it seems really good.

    But there is something wrong: in your help you said:

    "Events:

    Original from the SSTab:

    Click(PreviousTab As Integer)
    DblClick()
    KeyDown(KeyCode As Integer, Shift As Integer)
    KeyPress(KeyAscii As Integer)
    KeyUp(KeyCode As Integer, Shift As Integer)
    MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    OLECompleteDrag(Effect As Long)
    OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
    OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
    OLESetData(Data As DataObject, DataFormat As Integer)
    OLEStartDrag(Data As DataObject, AllowedEffects As Long)"


    That's not true, those events in the original sstab have all a first argument "index" i.e.

    Original SSTab
    MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)

    SStabex
    MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

    that's really a problem if you have to move to sstabex an existing code.

    Please can you fix it ?

    Best regards
    Maurizio

  13. #13
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by Maurizio View Post
    Please can you fix it ?

    Best regards
    Maurizio
    Not sure which SSTab you're using, but it's not the same everyone else is using.

    I'm kidding of course - but you're still mistaken. You have your SSTab setup as a Control Array.
    Delete whatever is in the the Index Property, so it's blank, and try and re-create your event functions.

    Start a new form, and add a new SSTab to verify.

  14. #14

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Yes, or make an array of SStabEx.
    How? Copy an SSTabEx control to the clipboard, then paste it into the same form, and when you are asked to create a control array, answer "yes".

  15. #15
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    673

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by Eduardo- View Post
    This control is a direct replacement of the SSTab control.

    Some enhancements are:

    • It supports Windows visual styles or themes
    • The background color of the tabs can be changed (property TabBackColor)
    • Another Style has been added (along with the two available in the original): it can be also rendered with the TabStrip look alike.
    • Several new events and properties available
    • More control at design time, for example the controls can be moved from one tab to another (that is available in a property page)
    • Since many properties that define the appearance can be customized, the customized values can be saved (from a property page) and restored into another SSTabEx control.
    • It fixes the focus to hidden controls issue that the original SSTab suffers when navigating with the tab key.


    Attachment 156005

    Name:  SSTabEx2.JPG
Views: 8237
Size:  13.6 KB

    One note: if you use the Tab property of the control in code, you'll have to change it to TabSel.
    I couldn't use Tab as a property name because it is a VB6 reserved keyword.

    It should work in any Windows version from Windows 2000.
    (Not tested, just tested on XP SP3).

    For documentation, there are two files:

    • _Readme - Notes.txt that is in the root folder, and explains things related to the component development and compiling.
    • And [root folder]/others/Help SSTabEx control.txt that is the control documentation, from the point of view of using the control. The same information is in a property page.


    Initial release: 06 Feb 2018.
    Last update: 26 Feb 2018
    Code:
     Begin vbExtra.SSTabEx SSTabEx1 
          Height          =   4116
          Left            =   252
          TabIndex        =   0
          Top             =   108
          Width           =   4644
          _ExtentX        =   8192
          _ExtentY        =   7260
          Tabs            =   7
          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
             Name            =   "Tahoma"
             Size            =   9
             Charset         =   0
             Weight          =   400
             Underline       =   0   'False
             Italic          =   0   'False
             Strikethrough   =   0   'False
          EndProperty
          TabsPerRow      =   4
          Tab             =   1
          TabHeight       =   582,083 'in your code this "," ,have error. in my system must change to "."
          Themed          =   -1  'True
          TabPic16(0)     =   "frmTest.frx":0166
          TabPic20(0)     =   "frmTest.frx":04B8
          TabPic24(0)     =   "frmTest.frx":09BA

  16. #16

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Updated.
    It turns out that it seems that there is a bug in VB6, that saves the single values of control properties localized (commas instead of points). These property settings then were rounded to integers to avoid the problem.

  17. #17
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by Elroy View Post
    Nice work, Eduardo. This (along with Krool's work) gives me a path to completely dump OCX files if I ever decide to do the necessary testing.
    Take Care,
    Elroy
    Hi Elroy,
    You are a big Tab user.
    Have you switched over (any of your projects) to use this yet ?
    How goes it ?
    Thanks,
    Rob
    PS I have never used the VB6 Tab control (except a couple of plays with it years ago).
    This might make me a believer.

  18. #18

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Updated, a bug related to properly show some themes fixed.
    09-Oct 2018: added property TabHoverEffect.

    TabHoverEffect: default is True.
    Returns/sets a value that determines if the tabs will show an effect when they are being highlighted with the mouse over them.
    It only works when the control is displayed without visual styles.

  19. #19

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Updated.

    A small bug fixed (in the highlight effect).

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

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by Bobbles View Post
    Hi Elroy,
    You are a big Tab user.
    Have you switched over (any of your projects) to use this yet ?
    How goes it ?
    Hi Bobbles,

    Sorry for the late response. And sorry, but I haven't switched over. My program is entirely in English, so I've got very little need for Unicode. In the few places where I do have a need, I use less comprehensive solutions.

    However, I do watch this thread as well as Krool's threads. All put together, it seems that a fairly complete Unicode solution is available for VB6. I do have a couple of installations where English isn't the primary language (one in Montreal and one in Manila). But I work entirely as a consultant (no charge for the software), and nobody has offered to pay me to convert the language. If they ever do, I may take a closer look at some of the Unicode controls (possibly switching over the whole project).

    And yes, I do use the SSTab control in several places in my primary project. Personally, I think it's an excellent control, in terms of both development and end-user function.

    Best Of Luck,
    Elroy
    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. To all, peace and happiness.

  21. #21
    Lively Member
    Join Date
    Feb 2007
    Posts
    126

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    I know this is an old thread but I'm trying to do something with SSTabEx (which works GREAT by the way, thanks for writing it) but I can't seem to figure out how to do it.
    I'd like the currently selected tab to be a different color (the tab itself not the caption) when active.

  22. #22

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by KenHorse View Post
    I'd like the currently selected tab to be a different color (the tab itself not the caption) when active.
    Hello, I added the properties TabSelBackColor and TabSelForeColor

    Also, in this last update, it now has RightToLeft support.

  23. #23
    Lively Member
    Join Date
    Feb 2007
    Posts
    126

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Question.

    In the readme, you say:

    To compile the OCX file:
    Got to File/Make... and make the OCX.
    Save the project.
    Close the IDE.
    Copy the *.OCX that you generated to the folder cmp
    Rename it as *.cmp
    Open the project in the IDE.
    Go to Project/Properties, and in the Components tab, in Binary compatibility select the file *.cmp in the folder cmp.
    Click OK.
    Save the project.

    I don't see a 'cmp' directory

  24. #24
    Lively Member
    Join Date
    Feb 2007
    Posts
    126

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Question.

    In the readme, you say:

    To compile the OCX file:
    Got to File/Make... and make the OCX.
    Save the project.
    Close the IDE.
    Copy the *.OCX that you generated to the folder cmp
    Rename it as *.cmp
    Open the project in the IDE.
    Go to Project/Properties, and in the Components tab, in Binary compatibility select the file *.cmp in the folder cmp.
    Click OK.
    Save the project.

    I don't see a 'cmp' directory

  25. #25

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by KenHorse View Post
    I don't see a 'cmp' directory
    I had named that folder "compat", but I usually use "cmp" for the folder name, and so I wrote there.
    Just rename the folder "compat" to "cmp".
    (anyway I will upload the zip again with the folder name already changed)

  26. #26
    Lively Member
    Join Date
    Feb 2007
    Posts
    126

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    One more stupid question if I may

    Got to File/Make... and make the OCX.
    Save the project.
    Close the IDE.
    Copy the *.OCX that you generated to the folder cmp
    Rename it as *.cmp
    Open the project in the IDE.
    Go to Project/Properties, and in the Components tab, in Binary compatibility select the file *.cmp in the folder cmp.
    Click OK.
    Save the project.

    I assume by that 2nd instance of "project", you mean the one you want to use the new SSTabEx in, correct?

  27. #27
    Lively Member
    Join Date
    Feb 2007
    Posts
    126

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Nevermind I figured it out

  28. #28

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Quote Originally Posted by KenHorse View Post
    One more stupid question if I may

    Got to File/Make... and make the OCX.
    Save the project.
    Close the IDE.
    Copy the *.OCX that you generated to the folder cmp
    Rename it as *.cmp
    Open the project in the IDE.
    Go to Project/Properties, and in the Components tab, in Binary compatibility select the file *.cmp in the folder cmp.
    Click OK.
    Save the project.

    I assume by that 2nd instance of "project", you mean the one you want to use the new SSTabEx in, correct?
    No, the "project" on that list is always the ocx project.

    But those steps are only necesary if you are going to compile the ocx more than once.
    They are necessary for keeping the compatibility of the ocx file if you compile the it later again, otherwise when loading the client that uses the old version of the ocx, you would get an error telling that the component could not be loaded (the client project, also called host project, is the exe project that uses the ocx).

    But doing so would not be really necessary if you are going to compile the ocx only once.

  29. #29
    Lively Member
    Join Date
    Feb 2007
    Posts
    126

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    As I am trying to "upgrade" from the previous version of SSTabEx, I can't get VB6 to allow me to remove the old component to add the new as they share the same 'name'......

  30. #30

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Are you using the SSTabEx in source code or have you compiled the OCX of the old version and you are using that now in the exe?

  31. #31
    Lively Member
    Join Date
    Feb 2007
    Posts
    126

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    I compiled and used the ocx. Finally figured the easiest thing to do was just replace the existing ocx (the original SSTabEx) with the new one. Problem solved

  32. #32

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    In that case you need to copy the old ocx file to the cmp folder of the project with new version and to set the compatibility to that file.
    Then compile the new ocx with the new version.

  33. #33
    Addicted Member
    Join Date
    Jun 2010
    Posts
    182

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Hi Eduardo and thanks for your work and a much welcomed control. Now, I have compiled it as an ocx and been working on implementing a first instance in my project. And for over 2 weeks it has all worked fine. Then today suddenly something went hey-wack, as can be see on the screenshots. To the left, how it looks in the IDE designer and to the right how it looks when I run the project in the IDE.

    Name:  tabide.png
Views: 4604
Size:  20.9 KB Name:  tabrun.png
Views: 4463
Size:  9.7 KB

    What happens here is that whichever of the 2 tabs that is set to show when the form first displays loks ok, but when I click on the 2nd tab everything seems to be moved to the left with about 50% of the containers width. Now if set in code to show the tab in the images first, it displays fine but the same happens with the other tab when it's clicked to get selected.

    I have no idea "why" this happens now of a sudden, it has worked fine up until today. The only change I did in my code, as far as I can recall, between functional and non-function control is to change this code:
    Code:
    tabChartEntry.TabSel = CInt(GetIniVal(INICHT, "EntryMode", "0", sIniFile))
    to this code:
    Code:
    With tabChartEntry
       .TabCaption(0) = cLang.GetString("529")
       .TabCaption(1) = cLang.GetString("840")
       .TabSel = CInt(GetIniVal(INICHT, "EntryMode", "0", sIniFile))
    End With
    in the startup form's Load event. Changing it back makes no change to the above.

    BTW, all controls in the containers are placed either on a picturebox or a frame control, to possibly avoid subclassing issues.

    I have not changed anything in the SSTabEx's code, but I have added the code to my own ActiveX project, which also contains other controls, and thus I changed the files path to avoid file collisions. This shouldn't be a source of problem though and I know what I am doing here, and as said it has worked fine for about 14 days or so.

    Oh, I recall now one thing that has happened since last successful run, that "might" can have impacted. Yesterday, while I was out shortly there was a power break that outlasted my APC Power Backup system, and as far as I know it did with VB6 IDE running, I may even have had my project in run mode, but cannot really recall. Just leaving this here for your information in case it tells you something.

    Thanks again and hope you may have an idea...
    M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?

  34. #34

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Hello. Can you attach the form (or send it in private)?
    I'm thinking but I don't figure something that could be happening to cause that.

  35. #35
    Addicted Member
    Join Date
    Jun 2010
    Posts
    182

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Hi Eduardo and thanks for quick reply. While I wrote my originally post I came to think of that power break, and then after it crossed my mind that some corrupt data got saved to the property bag or something. So I simply cut and pasted out the picture boxes with controls from the tab containers, deleted the control instance, sited a new tab and paste the picture boxes back - and not it all seems to work again. So I am fine. If it were to happen again, I will make a copy of the form immediately, before I start to experiment, and send it to you.

    Thanks.
    M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?

  36. #36
    New Member
    Join Date
    May 2020
    Posts
    7

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Changes to menu toolbar style
    Attachment 178157

    ctlSSTabEx Toolbar.zip
    Attached Images Attached Images  
    Last edited by ln_0; Aug 1st, 2020 at 09:41 AM.

  37. #37

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Hello, thanks for sharing it, they are nice effects.

    You have to take into account that if you leave the VisualStyles property to True and the program is manifested, it won't show the buttons styles.
    In my case I have the IDE manifested so I had to set the VisualStyles property to False to see the effect.

    Also, people with VB6 in other languages than Chinese can have problems loading the project.
    I'll upload here a version with the project's file name changed.
    Attached Files Attached Files

  38. #38

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Updated the download in the OP.
    Added fix to support high-DPI above 300.

  39. #39

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,996

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Fixed a bug introduced in the last update.

  40. #40
    Addicted Member
    Join Date
    Jun 2010
    Posts
    182

    Re: (VB6) SSTabEx: SSTab replacement. Themed and with new features

    Hi Eduardo,

    now it has happened again... suddenly, the tabs that are out of focus when showing the form, when selected don't show the picturebox containers with controls, just the tab background.

    This time, as I have got further in completing the whole form with controls outside of the tab control, I noticed that the controls in containers still worked indication they are there, somewhere. So I put in some debug code to see where they are by checking their .Left and .Top properties, and this is what I found:

    In the designer the 3 picturebox controls (in a control array) I use as containers all are set to .Left = 120 & .Top = 440

    When I check their locations in the Form_Load event, before I interact with the tab control, it shows:
    Tab0: Left 120 Top 440
    Tab1: Left -74880 Top 440
    Tab2: Left -74880 Top 440

    I then interact with the control by setting tab captions, and then in code select the tab selected on last program close. For simplicity I have used the sequential 0-1-2 order here, but the results are logically the same no matter which tab I start with, it always starts with same values as in the designer.

    So when the tab control first show, the selected visible tab has the correct values:
    Tab 0: Left 120 Top 440

    I then click on the 2nd tab and it has now changed to:
    Tab 1: Left-8583 Top 483

    Same when I click on the 3rd tab:
    Tab 2: Left-8583 Top 483

    I now click again on the first tab and look, it has changed position of the container as well, although it was correct to begin with:
    Tab 0: Left 134 Top 483

    These values then remains the same if go back and forth between the tabs.

    I can work around this by positioning the containers in my code, but even if I do this in the Form_Load event values of

    Tab 1: Left-8583 Top 483
    Tab 2: Left-8583 Top 483
    Tab 0: Left 134 Top 483

    comes back. So I have to do this later. To do it in the _TabSelChange() event works, although not optimal, but for now it's OK while I'm still coding ahead of release.

    Last time it worked by removing the containers, delete the tab control and site a new one, pasting back the containers (to cut and paste back the tab doesn't work in any way) but I will wait with that to see if I somehow can figure out what the problem is. The form itself is >400k and also contains a commercial control (UniSuitePlus) as well as some of my own controls, so I'm hesitant to that sending you the form would be of much help. Also, I cannot exclude that the problem is caused by something in my code or any of the other controls sited on the form.

    One thing is odd though, even when I put in my workaround to get the containers correctly placed, there is still an artifact on the 1st tab (tab(0)), a horizontal line just below the tabs and I suspect it's the container top border that is leaking through even if container BorderStyle = 0 - None and Apperance = 0 - Flat

    If this info brings some light to your thinking, great and I'm prepared to produce whatever info you may need, otherwise, don't let it trouble you, not yet ;-) I will try to investigate more as time allows, an din worst case I can always recreate the control instance as last measure before I complete my program.
    Last edited by 7edm; Aug 29th, 2020 at 08:10 PM. Reason: typos
    M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?

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