dcsimg
Results 1 to 28 of 28

Thread: no controls on usercontrol with SSTab in design time

  1. #1

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    no controls on usercontrol with SSTab in design time

    Hi everyone,

    How come you can't place controls, in design time, on a usercontrol that consists entirely of an SSTab - and how can I place controls on this usercontrol in design time? Any control that I try to add gets placed on the form instead.

    Thanks!
    Cooz

  2. #2
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Hello, to place controls into an UserControl, you need to first set its ControlContainer property to True.

    But... even then, you can only place controls into the UserControl itself, but you cannot set them into another control contained inside the UserControl, like a SSTab in this case.

    If you explain what are you traying to do (in other words: why you want to do this), may be we could help with other ideas.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  3. #3
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,691

    Re: no controls on usercontrol with SSTab in design time

    I'm totally unclear on what y'all are doing.

    Attached is a project with SSTab as a reference. It's got a UC with SSTab on it. On the SSTab of the UC, it also has a TextBox on tab #1. I run the project and everything works perfectly. Furthermore, the UC isn't marked as a Container control, but the SSTab is already a container control.

    Cooz, what version of SSTab are you using?
    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.

  4. #4
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Quote Originally Posted by Elroy View Post
    I'm totally unclear on what y'all are doing.

    Attached is a project with SSTab as a reference. It's got a UC with SSTab on it. On the SSTab of the UC, it also has a TextBox on tab #1. I run the project and everything works perfectly. Furthermore, the UC isn't marked as a Container control, but the SSTab is already a container control.

    Cooz, what version of SSTab are you using?
    As I understand, he wants to place controls from the designer of the form inside the SSTab that is in the UserControl.

    But since he said "at design time", and assuming that the UserControl is in the same EXE project as the form, now I'm thinking that you may be right, he just needs to open the desinger of the UserControl and add the controls inside the SSTab from there.

    Edit: But if the wants to reuse this UserControl in another form but with different controls inside, he won't be able.
    He would have to add another UserControl with the different controls.

    And what would be the point of using an UserControl in that case, if it can't serve to reuse it?

    That why I asked what he was trying to acchieve. (why an SStab inside an UserControl?)
    Last edited by Eduardo-; Feb 5th, 2018 at 12:48 PM.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  5. #5
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,691

    Re: no controls on usercontrol with SSTab in design time

    Quote Originally Posted by Eduardo- View Post
    As I understand, he wants to place controls from the designer of the form inside the SSTab that is in the UserControl.
    Ahhh, I didn't even think about that. IMHO, if that's what he's trying to do, then he shouldn't be putting the SSTab inside a UC to begin with. I suppose you could write some code that detected when a control was dropped onto the UC, and then patch up it's container so it would be on the active tab of the SSTab. But that sort of feels like silliness to me. But who knows, maybe he's got a legitimate reason for wanting/needing to do this. IDK though, if everything we're talking about is just in the IDE (and not even when running), then he just needs to bite-the-bullet and design what he wants without a fancy UC.

    Cooz, sorry if that came off as curt. I do think maybe we need some more flesh on these bones though. Would you mind outlining why you're putting an SSTab on a UC? I'm not saying it shouldn't be done. But it does seem a bit unusual to put such a sophisticated control on a UC.

    All The Best,
    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. 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.

  6. #6
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Quote Originally Posted by Elroy View Post
    I suppose you could write some code that detected when a control was dropped onto the UC,
    Yes, but that is not trivial.

    Quote Originally Posted by Elroy View Post
    and then patch up it's container so it would be on the active tab of the SSTab.
    I repeat: you can't change the container like that. Try it yourself.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  7. #7
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,691

    Re: no controls on usercontrol with SSTab in design time

    Hmmm, you mean something like this?

    Name:  Image1.jpg
Views: 135
Size:  52.3 KB

    Name:  Image2.jpg
Views: 136
Size:  52.2 KB

    It seems to work fine for me. I've attached my little demo project. Just change the "TheContainer" property of the UC, and the TextBox jumps from one PictureBox to the other.

    Maybe you're reading the MSDN about the Container property. It says you can't change it in design mode. However, a UC isn't exactly in design mode unless you have it open.

    Take Care,
    Elroy

    EDIT1: For grins, I also set the ControlContainer property to True, and then also change the UC's code to the following:

    Code:
    
    Option Explicit
    Dim iContain As Long
    
    Public Property Get TheContainer() As Long
        If iContain < 0 Then iContain = 0
        If iContain > 2 Then iContain = 2
        TheContainer = iContain
    End Property
    
    Public Property Let TheContainer(ByVal i As Long)
        If i < 0 Then i = 0
        If i > 2 Then i = 2
        iContain = i
        Select Case iContain
        Case 0: Set Text1.Container = Me
        Case 1: Set Text1.Container = Picture1
        Case 2: Set Text1.Container = Picture2
        End Select
    End Property
    
    
    
    You can now change the TheContainer property to 0, and it sets the TextBox directly on the UC. You may want to move the PictureBoxes around a bit so you can see it, but it all works perfectly.
    Attached Files Attached Files
    Last edited by Elroy; Feb 5th, 2018 at 06:47 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.

  8. #8
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Check attachment.
    Attached Files Attached Files
    Last edited by Eduardo-; Feb 6th, 2018 at 12:50 PM.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  9. #9

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    Hi Eduardo and Elroy,

    Thanks for your contributions!

    (Eduardo: ) "But... even then, you can only place controls into the UserControl itself, but you cannot set them into another control contained inside the UserControl, like a SSTab in this case."
    Thanks... I did not know about the ControlContainer property. By setting it to True, placing another control on the SSTab indeed places it directly on the usercontrol: it remains visible when switching tabs. Which is not what I intended.

    Let me clarify a little: I need a usercontrol that functions like an SSTab, no more and no less, both at design time and at run time; the only thing is that I'm faced with the need for a white tab control (like an SSTab). It has to replace the SSTabs currently in use, and it must allow to be added to new forms in the future.
    Since the SSTab does not have a property that gets rid of the ugly gray color, in two or three SSTabs that are in use I added a white rectangle shape as background, plus code that assures that the shape behaves correctly. The tabs themselves remain gray - alas, I guess I'll have to live with that.
    Two or three... only about 60 more to go.

    (Eduardo: ) "As I understand, he wants to place controls from the designer of the form inside the SSTab that is in the UserControl."
    Exactly!

    (Elroy: ) "Cooz, sorry if that came off as curt."
    That's okay.

    If I have a white-SSTab-usercontrol like this, about all I need to do is perform a search and replace ("Begin VB.SSTab" by "Begin XXX.WhiteSSTab") throughout my .frm files, and I'm done.
    But it looks like I'm being a little too optimistic here.

  10. #10
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Hello, you can use my SStab replacement that I just posted here.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  11. #11

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    Whoa Eduardo! Cool!
    I'll check it out right away! Thank you!

  12. #12
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,691

    Re: no controls on usercontrol with SSTab in design time

    @Eduardo: Your UserControl_ContainedControls.zip attachment doesn't have the UserControl1.ctl file included. I was going to take a look at what you were attempting to illustrate, but it didn't execute.
    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.

  13. #13
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Quote Originally Posted by Elroy View Post
    @Eduardo: Your UserControl_ContainedControls.zip attachment doesn't have the UserControl1.ctl file included. I was going to take a look at what you were attempting to illustrate, but it didn't execute.
    Sorry, now updated.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  14. #14
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    4,691

    Re: no controls on usercontrol with SSTab in design time

    Ahhh, ok, I now see the point you're trying to make.

    I think this is all somewhat moot because you can't (easily) change the tabs on an SSTab that's in a UC, so what's the point.

    However, just to continue this idea of changing containers ... yes, of course you can't execute non-UC code while in design mode (with the exception of the Immediate Window). However, even with the Immediate Window, we can't instantiate our Form1, so we can't directly access any of the controls on it. However, if we stay strictly with code in the UC (as my illustration did), we can indeed mess with the container. Did you try my example in post #7?

    Again, I think Cooz might be well on his way, possibly using your SSTab replacement. If you've given him the source code, it shouldn't be difficult to find a way to modify the color of the tabs, which is what he seems to want.

    Cooz, if it were me, and I wanted this, I'd get stubborn and find a way to do it correctly (i.e., no extraneous boxes). It might take subclassing, but that's okay. It sounds like Eduardo's control might be a nice answer.

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

  15. #15
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Quote Originally Posted by Elroy View Post
    Ahhh, ok, I now see the point you're trying to make.

    I think this is all somewhat moot because you can't (easily) change the tabs on an SSTab that's in a UC, so what's the point.

    However, just to continue this idea of changing containers ... yes, of course you can't execute non-UC code while in design mode (with the exception of the Immediate Window). However, even with the Immediate Window, we can't instantiate our Form1, so we can't directly access any of the controls on it. However, if we stay strictly with code in the UC (as my illustration did), we can indeed mess with the container. Did you try my example in post #7?
    The issue is not that you cannot change the container, it is that you cannot change the parent.

    In your example, the parent of the control is the UserControl, you changed container but always inside the UserControl.

    In my example, the parent of the control is the form, and I attempted to put it inside a control that is in the UserControl. And that's not possible.

    Quote Originally Posted by Elroy View Post
    Again, I think Cooz might be well on his way, possibly using your SSTab replacement. If you've given him the source code, it shouldn't be difficult to find a way to modify the color of the tabs, which is what he seems to want.
    He doesn't need to modify the source code for doing that. It is already possible to change the background color in that control (TabBackColor property).
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  16. #16

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    Eduardo, the SSTabEx sometimes seems to remove tab contents. As you can see in the below screendumps, the Verwijderen gegevens and Extra velden tab get wiped out when reactivated. The four tabs Gebruikers - Keuzelijsten work fine. Do you have an idea what's going on here?

    Thanks once again,
    Cooz

    Name:  vergeg1.jpg
Views: 112
Size:  24.0 KB
    Name:  extvel1.jpg
Views: 113
Size:  28.4 KB
    Name:  vergeg2.jpg
Views: 106
Size:  15.8 KB
    Name:  extvel2.jpg
Views: 105
Size:  15.7 KB

  17. #17
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Cooz,

    Use 1) it compiled (better) or 2) uncomment this line: '#Const NOSUBCLASSINIDE = True
    With the second option the control won't be clickeable at design time, and you'll have to change the tabs by changing the property value of TabSel.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  18. #18

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    Eduardo,

    I uncommented the line, then made the .ocx, and added the .ocx to my .vbp's by means of the Project | Components menu.
    But it didn't help.

  19. #19
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Quote Originally Posted by Cooz View Post
    Eduardo,

    I uncommented the line, then made the .ocx, and added the .ocx to my .vbp's by means of the Project | Components menu.
    But it didn't help.
    Cooz,

    You need to also remove the TabExCtl project from the projects list.

    What do you mean "it didn't help"?
    Once the controls "are lost", it won't fix it. But it will help in that you won't lose controls again.
    Once the controls "are lost", they are not really lost, they are gone to another tab.
    You can relocate the controls by going to the property page Tabs, and clicking on the button "Move a control to this tab".

    If you think that it is really still causing controls to dissapear, please provide a example, in a new and simple project, and please describe step by step how to reproduce the problem.
    If there is really a bug I can fix it. Thanks.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  20. #20

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    Hi Eduardo,

    "What do you mean 'it didn't help'?"
    I meant that it didn't make a difference. The controls on the "Verwijderen gegevens" and "Extra velden" tabs in the screendumps I provided, are gone the second time I activate those tabs. Controls on the last tab, "Correspondentie", don't show up at all by the way.
    This is only one example - I have at least two other SSTabExes now that display similar behavior, and at least one SSTabEx that functions correctly.

    "You can relocate the controls by going to the property page Tabs, and clicking on the button 'Move a control to this tab'."
    Yes, but that is at design time. Everything looks great at design time. It is only when running the form and clicking a tab a second time (or, of course, a third, fourth...) that its controls have gone. It is strange that only some tabs seem to be affected - others look good and remain good.

    Probably I'm overlooking something. Unfortunately it is not possible for me to provide a simple project that reproduces the behavior: I have no doubt that your SSTabEx will work fine when I add it to a form and test it from there, and I cannot isolate (one of) the forms on which the behavior occurs and have the form functioning properly. These forms have far too many dependencies.

    I can describe step by step what I do though - perhaps this will shed some light.
    In detail, I:

    (to retrieve the .ocx: )
    - opened your Group1.vbg in the VB6 editor;
    - uncommented #Const NOSUBCLASSINIDE = True;
    - saved Group1.vbg;
    - selected File | Make TabExCtl.ocx...;
    - copied the TabExCtl.ocx to the directory with my source code files (for the time being - I'm not quite sure what location the ocx will end up in);

    (to obtain a correct reference to the .ocx: )
    - opened a new project in VB6;
    - added the SSTabEx to this project by means of Project | Components... and browsing to the newly created TabExCtl.ocx;
    - saved this project;
    - opened its .vbp file in a text editor to locate the line that designates the reference to the .ocx ("Object={34E4C14D-71C4-4468-955B-1741E0147B1A}#6.0#0; TabExCtl.ocx");

    (to update my projects - i.e. replace the SSTab control by the SSTabEx control - wrote and executed a script that: )
    - in each .frm, .ctl, .bas, and .cls file:
    -- replaces ".Tab " with ".TabSel " (and ".Tab¶" with ".TabSel¶", ".Tab," with ".TabSel," and ".Tab)" with ".TabSel)");
    -- replaces " SSTab " with " SSTabEx " (and " SSTab¶" with " SSTabEx¶", " SSTab," with " SSTabEx," and " SSTab)" with " SSTabEx)");
    -- replaces "Begin TabDlg.SSTab" with "Begin TabExCtl.SSTabEx¶ TabBackColor = &H00FFFFFF";
    - in each .vbp file:
    -- adds the line "Object={34E4C14D-71C4-4468-955B-1741E0147B1A}#6.0#0; TabExCtl.ocx"

    All projects compile fine, and as far as I can see do not cough up any errors - which suggests that the script is okay. So I am still a little at a loss here, and I hope the information I gave will give you some insight in what is happening here. I am aware that what I actually do is not in your documentation - but it sounds logical to me and I have to replace the SSTabs by means of a script. It is far too much code to do the replacing manually, one at a time.

  21. #21
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Quote Originally Posted by Cooz View Post
    - uncommented #Const NOSUBCLASSINIDE = True;
    If you use the component compiled, that's not neccesary to do.

    About the problem, do you mean that everything works fine when you run the program uncompiled in the IDE, but the problems arise when it runs compiled in the exe?

    Does the problem happen in the same computer where you develop or when running in another computer?

    I have a couple of programs using it, one with many SSTabExs and complex forms, and I just checked it (again) and it seems to work fine.

    I'm a bit worried now, because I have no idea what could be happening there...

    The only way to track problems that only occur compiled is to place logging intructions on the source code, it is something rather complex. If there is a problem I would like to do it, but as a first step I need to be able to reproduce the problem.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  22. #22
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    I'm thinking what could be causing this problem.

    I have one question: did you remove the component project after compiling the OCX? I mean the project "TabExCtl" from the projects list in the IDE?

    If not, then please do this test: comment the line #Const NOSUBCLASSINIDE = True again.
    Run (F5).

    You said that in the IDE it worked fine (no controls lost).
    How is it working now in the IDE, are the controls lost?
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  23. #23

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    "If you use the component compiled, that's not neccesary to do."
    Well, I did anyway.

    "About the problem, do you mean that everything works fine when you run the program uncompiled in the IDE, but the problems arise when it runs compiled in the exe?"
    No... I run the program from the IDE and encounter the behavior. I haven't compiled it into an exe.

    "Does the problem happen in the same computer where you develop or when running in another computer?"
    It happens in the same computer where I develop; I haven't used a different computer.

    "I have one question: did you remove the component project after compiling the OCX? I mean the project "TabExCtl" from the projects list in the IDE?"
    No, I did not - and I'm not sure why I would want to do that or what you mean exactly. I compile the ocx from your Group1.vbg; I have not added the TabExCtl project to (each of) my projects so I can't remove it from there. It doesn't make sense to remove it from your Group1.vbg.
    But perhaps I interpret you wrong; you want me to do something that I indeed haven't done so that may be the cause. Can you elaborate on this? I have to remove the TabExCtl project from...?

    I must add that I've just tried adding the TabExCtl project to the project of which I've included the screendumps earlier on, and running the whole thing from the IDE. The intention was that, should it work, I'd compile the ocx from there, add the ocx to the project, remove the TabExCtl project (I'm pretty sure now that this approach is the one you have in mind) and test once more. But "running the whole thing from the IDE" already gave me the empty tabs.

    "If not, then please do this test: comment the line #Const NOSUBCLASSINIDE = True again. Run (F5)."
    I did - I've tried both commented and uncommented.

    "You said that in the IDE it worked fine (no controls lost)."
    No, not exactly: the SSTabEx looks great at design time is what I meant - indeed with all controls fully visible, as they are when at run time you activate an affected tab the first time.

    "How is it working now in the IDE, are the controls lost?"
    Yes, they are still lost, alas.

    I noticed one small typo in your _Readme - Notes.txt file, which refers to the 'usr' folder. This is the 'usc' folder. It's not a big deal, but it made me open TabExCtl.vbp in a text editor to verify this - just to be sure.

    I think I'll leave it at this Eduardo - in the meantime I've been working on adding a background to my SSTabs by stretching a shape across them, and actually made some progress here. Which is not to say I'm no longer open to any suggestions from your side: it'd be great to have the tab tabs in white as well, which I obviously won't obtain with added shapes. And I really do appreciate the time and effort you spent in helping me!

  24. #24
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Edit: I made a new release of the control.
    I think I must have fixed the bug.
    Please test with the new version.

    Anyway, here is what I wrote before (before editing the message after the new release of the control):

    Quote Originally Posted by Cooz View Post
    No... I run the program from the IDE and encounter the behavior. I haven't compiled it into an exe.
    Well, that's a better situation then to investigate the problem.

    Question 1: do you have any third party component on the form, anything like a Resize component or the like?

    Question 2: do you have code in the Click event of the SSTabEx? (or in other event of the control)

    Quote Originally Posted by Cooz View Post
    "I have one question: did you remove the component project after compiling the OCX? I mean the project "TabExCtl" from the projects list in the IDE?"
    No, I did not - and I'm not sure why I would want to do that or what you mean exactly. I compile the ocx from your Group1.vbg; I have not added the TabExCtl project to (each of) my projects so I can't remove it from there. It doesn't make sense to remove it from your Group1.vbg.
    Yes, it makes sense. If you don't remove the "TabExCtl" from the list, it still runs in source code. It means nothing that you generated the OCX file, if you have the project in the projects list, it runs uncompiled anyway.
    For running it compiled, you need not only to generate the OCX, but also to remove the project from the list.

    Quote Originally Posted by Cooz View Post
    But perhaps I interpret you wrong; you want me to do something that I indeed haven't done so that may be the cause. Can you elaborate on this? I have to remove the TabExCtl project from...?
    You can:
    1) Open your exe project from the *.vbp file, not from the *.vbg.
    2) Or if you opened it from the *.vbg:
    a) Remove the project from the projects window: press Ctrl+R to show that window, then right click on TabExCtl, then select "Remove project".
    b) Or press Ctrl+R to show the projects window, select TabExCtl, go to the main menu "File" and select submenu "Remove project".

    Quote Originally Posted by Cooz View Post
    I must add that I've just tried adding the TabExCtl project to the project of which I've included the screendumps earlier on, and running the whole thing from the IDE. The intention was that, should it work, I'd compile the ocx from there, add the ocx to the project, remove the TabExCtl project (I'm pretty sure now that this approach is the one you have in mind) and test once more. But "running the whole thing from the IDE" already gave me the empty tabs.
    May be you already did what I said above then.

    Quote Originally Posted by Cooz View Post
    "If not, then please do this test: comment the line #Const NOSUBCLASSINIDE = True again. Run (F5)."
    I did - I've tried both commented and uncommented.
    OK.

    Quote Originally Posted by Cooz View Post
    "You said that in the IDE it worked fine (no controls lost)."
    No, not exactly: the SSTabEx looks great at design time is what I meant - indeed with all controls fully visible, as they are when at run time you activate an affected tab the first time.
    OK, now I have more clarity about what's happening.

    Quote Originally Posted by Cooz View Post
    I noticed one small typo in your _Readme - Notes.txt file, which refers to the 'usr' folder. This is the 'usc' folder.
    Thank you, now corrected in my source files.
    This will be corrected in the download later, may be when I change something else.
    After edit: already corrected now.

    Quote Originally Posted by Cooz View Post
    I think I'll leave it at this Eduardo - in the meantime I've been working on adding a background to my SSTabs by stretching a shape across them, and actually made some progress here. Which is not to say I'm no longer open to any suggestions from your side: it'd be great to have the tab tabs in white as well, which I obviously won't obtain with added shapes. And I really do appreciate the time and effort you spent in helping me!
    I really would like to fix whatever error in happening there. For you, and for any other that can come across this problem.
    And because supposedly there is a problem with my control and I have no idea what it is, and it will be left there if I don't find and fix it.
    Or at least to know that it was caused for a trird party control that is incompatible with it (or to make my component compatible, if possible).

    But the only way I have to do that is to have a program that is having the problem.
    I'm guessing may be something in your source code, I would start commenting the code in the Click event of the control, then in the Form_Load event, then in the Form_Resize event.
    Then all the code of the form, and see if the problem still happen or not.

    That is the way to narrow down the situation and to find what is happening.

    If the problem still occurs with no code on the form, then start removing some controls, and see when the problem goes away.

    It is not easy to find some bugs, but that procedure I described above to narrow down the situation is a lot easier than writting the control, believe me.
    Last edited by Eduardo-; Feb 13th, 2018 at 08:33 AM.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  25. #25

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    Eduardo...

    "I'm guessing may be something in your source code, I would start commenting the code in the Click event of the control, then in the Form_Load event, then in the Form_Resize event.
    Then all the code of the form, and see if the problem still happen or not."
    Yes, that's only fair. I'll see what I can do.

    I have compiled your new version into an ocx, and the project I add it to does not have any SSTabEx source code (somehow I didn't get the source-code-only-version to work this time: I kept getting log files stating that "Class TabExCtl.SSTabEx of control ... was not a loaded control class.")
    Now when I run it from the IDE, I get a compile error on Private Sub oTab_Click(PreviousTab As Integer) where oTab is an SSTabEx:

    Procedure declaration does not match description of event or procedure having the same name.

  26. #26
    Frenzied Member
    Join Date
    Feb 2017
    Posts
    1,223

    Re: no controls on usercontrol with SSTab in design time

    Quote Originally Posted by Cooz View Post
    Eduardo...

    "I'm guessing may be something in your source code, I would start commenting the code in the Click event of the control, then in the Form_Load event, then in the Form_Resize event.
    Then all the code of the form, and see if the problem still happen or not."
    Yes, that's only fair. I'll see what I can do.

    I have compiled your new version into an ocx, and the project I add it to does not have any SSTabEx source code (somehow I didn't get the source-code-only-version to work this time: I kept getting log files stating that "Class TabExCtl.SSTabEx of control ... was not a loaded control class.")
    Now when I run it from the IDE, I get a compile error on Private Sub oTab_Click(PreviousTab As Integer) where oTab is an SSTabEx:

    Procedure declaration does not match description of event or procedure having the same name.
    Just overwrite the new uscSSTabEx.ctl and uscSSTabEx.ctx files into the old project that you had already working.
    vbExtra: Print preview for VB6, print FlexGrids and more.
    MSDN online for VB6, Language reference.

  27. #27

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    Eduardo - forgive me for not replying. I haven't forgotten you; it's just that I'm very busy at the moment.
    The moment I've got an opportunity to provide you with more information I won't hesitate to do so.

  28. #28

    Thread Starter
    Member
    Join Date
    May 2017
    Location
    The Netherlands
    Posts
    42

    Re: no controls on usercontrol with SSTab in design time

    Eduardo,
    My sincere apologies for the delay. Here are my findings.

    Somehow I now only manage to get a running project by compiling the ocx first. If I add your source code to my project, save it and close it, execute my script and then load my project in the IDE once more, I get a log file containing "Line ###: Class TabExCtl.SSTabEx of control oTab was not a loaded control class." as well as several "Error occurred during load." messageboxes. This does not happen if I add the ocx by means of Project | Components... instead of adding the source code - and then save it and close it et cetera.

    Anyway, I got the same results as before with your new SSTabEx version. Now I continued with what you proposed:
    • "commenting the code in the Click event of the control" This did not make any difference.
    • Next step: "...then in the Form_Load event" This did not make any difference either.
    • Next step: ...then in the Form_Resize event" The form does not have a resize event.
    • It does have a Form_Activate event, however, and commenting the code here finally got me some progress. The tab "Extra velden" appears to have additional code: an object of a certain class ("TabUserFields") is made to control this tab. When I skip the line that creates the object, the SSTabEx works fine. The tab "Extra velden" shows its controls not properly initialized however, which was to be expected.


    I've tried commenting out the TabUserFields's Class_Initialize, but this results in an error I can't seem to get past; I did the same in the original project with the SSTab, which resulted in the same error. I've stepped line by line through both project varieties; of course the relevant TabUserFields lines call code which calls code which calls code which calls code ad almost infinitum. And it is not my code (it would have made this operation much easier if it was), nor did I spot any differences in behavior between the SSTab and the SSTabEx projects while stepping through the lines - until once again an empty tab showed up.
    I have spent the past eight hours trying to pinpoint what could be the cause of the empty tabs - in the end to no avail. Sorry!

    I am afraid I can't help you any further here. If you can get your hands on some large VB6 project(s), perhaps you'll be able to discover the cause of the problem yourself if you replace the SSTabs by SSTabExs. If it pops up. If, if, if.

    I once more thank you for your effort in helping me. It's appreciated!

    Cooz

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width