Page 3 of 6 FirstFirst 123456 LastLast
Results 81 to 120 of 225

Thread: NewTab: tab control for VB6

  1. #81

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Quote Originally Posted by xiaoyao View Post
    the new version is more difficult to register on a few computers.
    Nonsense. Please stop.

  2. #82
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,834

    Re: NewTab: tab control for VB6

    RC6.DLL I found that 3 of my friends could not register successfully on their computers.
    (By that I mean embedding the control source code to vb6 project. The problem of registration failure can be avoided.Of course, there is also a method of exemption from registration, which is also possible. It's just that some new users can't use it yet.

    Some new versions of OCX, com, and DLL use more of the windows API, so they can cause, ah, registration failures on some older systems.

    So keep some of the old versions, and there will be higher compatibility.)
    Maybe the translation software didn't explain it clearly.
    Some may be anti-virus software blocked, some may be the system non-administrator account permission is not enough.

    I am saying that when compiling the project containing the control source code as EXE software, select the compilation option (to make the file size smaller) (to make the running speed faster).
    It can also reduce the size of the EXE volume after compilation. Reduced from 1.3MB to only 640kb

    NEWTAB.OCX 1.3MB
    Compiled as an EXE, all files retained: 1.13MB, 40% larger than the minimum version
    Retain only the most basic control functionality: 820KB(340KB less)
    The optimized code size is 644kb, (Compile in the way of running speed first.)744KB

    I have no ill will, originally is 2 words finished, the result replies so much. I'M SORRY
    Last edited by xiaoyao; Oct 8th, 2023 at 01:46 PM.

  3. #83
    Addicted Member
    Join Date
    Feb 2022
    Posts
    189

    Re: NewTab: tab control for VB6

    Excellent work, thanks for the update!
    Last edited by taishan; Oct 28th, 2023 at 03:54 PM.

  4. #84
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    262

    Re: NewTab: tab control for VB6

    Hi Eduardo,

    Quick question: when I disable the tabcontrol, the images used on the tabs with the Picture property are automatically greyed out. Is it possible to keep these the same as when the tabcontrol is enabled?

    Thx,
    Erwin

  5. #85

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Erwin69 View Post
    Hi Eduardo,

    Quick question: when I disable the tabcontrol, the images used on the tabs with the Picture property are automatically greyed out. Is it possible to keep these the same as when the tabcontrol is enabled?

    Thx,
    Erwin
    Update released.
    Changed that behavior in the current version.
    Now the bitmap pictures are grayed only when the particular tab is disabled but not when the whole control is disabled.

    BTW: I also added a new property 'TabsEndFreeSpace': Returns/sets the size of an optional free space after the last tab (rightmost tab for the top orientation).

  6. #86
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    262

    Re: NewTab: tab control for VB6

    Hi Eduardo,

    I’m afraid that I have to come back to you on #60 in the thread.

    During testing I discovered that when buttons on the tab were clicked during the loading of the items in the listview, Windows buffered these, and started the code behind them either already during the loading, or afterwards. So I went through, and discovered a DoEvents statement in the listview processing that was there to allow the progress bar to be updated.

    I cleaned up the code to make sure no DoEvents were around, I'll worry about showing the updates on the progress bar later, and installed your latest OCX.

    Much to my sadness, clicking on the tab doesn’t refresh anything, until the listview is fully loaded.

    This is the code I currently have:

    Code:
    Private Sub tabMainForm_Click(PreviousTab As Integer)
         tabMainForm.Refresh
    End Sub
    
    Private Sub tabMainForm_TabSelChange()
         tabMainForm.Refresh
    
        'Actions depend on the tab that was selected
        If tabMainForm.TabSel = 2 Then
            ‘Populate treeview and listview
        End If
    End Sub
    I’ve tried also with adding tabMainForm.Redraw = True before the refresh statements. Didn’t make a difference.

    Tested in the IDE, as well as compiled on Windows 10, but unfortunately all the same.

    What do I do wrong?

    Thanks,
    Erwin

  7. #87

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Erwin69 View Post
    What do I do wrong?
    You told me that you didn't need to update the control:

    Quote Originally Posted by Erwin69 View Post
    Great! Using the TabSelChange in combination with the Refresh did solve the issue. Didn't even need to download the latest version.
    I suggest you to test with the latest version, then tell me whether it is working as expected or not.

    PS: It worked before because you had a DoEvents in your code, now that you don't have the DoEvents anymore, you'll need to update the control to the latest version for the .Refresh to properly work.

  8. #88
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    262

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    You told me that you didn't need to update the control:

    I suggest you to test with the latest version, then tell me whether it is working as expected or not.

    PS: It worked before because you had a DoEvents in your code, now that you don't have the DoEvents anymore, you'll need to update the control to the latest version for the .Refresh to properly work.
    Hi Eduardo,

    I did install and register the latest version of the OCX. Just double checked and this is what's in the vbp-file:

    Object={66E63055-5A66-4C79-9327-4BC077858695}#3.2#0; NewTab01.ocx

    I also confirm that it worked before as there was still a DoEvents in the code. (The code that fills the treecontrol and the listview calls several routines and functions, and one DoEvents was deep down in there, hence I missed that last time.) Now that this is gone, the tab is only painted when all code is finished.

    Note that if I put a MsgBox statement in the Click event, nothing happens. However, if that statement is added as the first line in the TabSelChange event, the tab is painted. It then is even painted without the .Refresh

    Regards,
    Erwin

  9. #89

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Just put the NewTabX.Refresh at the beginning of the TabSelChange event.

    Did it work or not?

    If no, what exactly is the issue?

  10. #90
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    262

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    Just put the NewTabX.Refresh at the beginning of the TabSelChange event.

    Did it work or not?

    If no, what exactly is the issue?
    That's where it is:

    Code:
    Private Sub tabMainForm_TabSelChange()
         tabMainForm.Refresh
    
        'Actions depend on the tab that was selected
        If tabMainForm.TabSel = 2 Then
            ‘Populate treeview and listview
        End If
    End Sub
    The issue is that I see that the tab is being selected (the text in the tab gets bold) but none of the controls on the tab are being displayed. The controls of the previously selected tab remain visible, and the controls on the newly selected tab are only displayed after the code in the TabSelChange event has finished processing.

  11. #91

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    In these cases it is better to add a Timer control, Interval 15 ms, Enabled = False at design time.
    Then in the tab change event, if it is the tab where the long process must take place, set the timer Enabled = True.
    Then move the long process to the timer. And of course set the timer to Enabled = False from its timer procedure too.

    It is not a problem of the tab Control. The other controls paintings are not updated (what is normal anyway in such cases).

  12. #92
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,233

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Erwin69 View Post
    The issue is that I see that the tab is being selected (the text in the tab gets bold) but none of the controls on the tab are being displayed. The controls of the previously selected tab remain visible, and the controls on the newly selected tab are only displayed after the code in the TabSelChange event has finished processing.
    Try calling UpdateWindow API on the form's hWnd. This is effectively sending WM_PAINT out of order i.e. without waiting for other messages to dequeue (contrary to InvalidateWindow API which posts WM_PAINT at the end of the message queue).

    This might not work if show/hide animations are involved which obviously cannot happen while TabSelChange event handler is stalling UI thread populating the list-view.

    cheers,
    </wqw>

  13. #93
    New Member
    Join Date
    Apr 2008
    Posts
    6

    Re: NewTab: tab control for VB6

    In case no one else has encountered this, I downloaded the modded VBA6.DLL from GitHub and tried it on WIndows 7 Ultimate 64 Bit in Vb6 Service Pack 6. VB6 throws an error when it encounters DatePicker1.Format = dtpCustom. I don't get the error with the original DLL. From the screen shots I've seen, your tab control looks great and I might use it on a project that doesn't use a date picker.

  14. #94

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Urba1952 View Post
    In case no one else has encountered this, I downloaded the modded VBA6.DLL from GitHub and tried it on WIndows 7 Ultimate 64 Bit in Vb6 Service Pack 6. VB6 throws an error when it encounters DatePicker1.Format = dtpCustom. I don't get the error with the original DLL. From the screen shots I've seen, your tab control looks great and I might use it on a project that doesn't use a date picker.
    I tried with a DTPicker from Microsoft Windows Common Controls 2 6.0 but could not replicate the error.
    Could you upload a small sample project where you see the error? (*.VBP and *.FRM zipped)

  15. #95
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    262

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    In these cases it is better to add a Timer control, Interval 15 ms, Enabled = False at design time.
    Then in the tab change event, if it is the tab where the long process must take place, set the timer Enabled = True.
    Then move the long process to the timer. And of course set the timer to Enabled = False from its timer procedure too.

    It is not a problem of the tab Control. The other controls paintings are not updated (what is normal anyway in such cases).
    Hi Eduardo,

    This did the trick! 15ms seemed a bit too tight, so I settled for 100ms, and all seems to work great. Will do more testing in the upcoming days, but the results so far look very good.

    Once again many thanks!!! Not only for a great tab-control, but also for your support in finding solutions to challenges that may only be sideways related to your control, if at all. It is greatly appreciated.

    Thanks,
    Erwin

  16. #96

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Update released.

    2023-11-28 Changed to OLE version 5.0.
    2023-11-27 Added ntTabOrientationLeftHorizontal and ntTabOrientationRightHorizontal options to the TabOrientation property.
    2023-11-22 Several minor bugs fixed.

    Now the left and right orientation can show the captions horizontally.

    Name:  ntLeftHor.png
Views: 447
Size:  1.7 KB

  17. #97
    Lively Member
    Join Date
    Oct 2014
    Posts
    102

    Re: NewTab: tab control for VB6

    Hello Eduardo!

    Thank you for providing such an excellent tab control.

    Can multiple forms be opened in the NewTab tab, and when a tab is selected, the corresponding form will be displayed on the tab. When the tab is closed, the form is automatically uninstalled (or when the form is uninstalled, the corresponding tab is automatically closed). When the size of a tab changes, the size of the form changes with the size of the tab.

    If convenient, could you please add such an example in the presentation file.

    Thank you very much!
    Similar effects:
    Name:  TabContcorl.jpg
Views: 395
Size:  11.8 KB

  18. #98

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Interesting request. I'll consider it but I don't promise when I'll do it (or if ever).

    To do it automatically I'll have to expand the TDIMode property from a boolean to an enum like ntTDINone, ntTDIControls and ntTDIForms.
    And then, detect when a form is going to be shown modally or non-modally and place every non-modal form in a tab (with the SetParent API), and allow modal forms to display normally. Probably with a CBT hook.

  19. #99
    Lively Member
    Join Date
    Oct 2014
    Posts
    102

    Re: NewTab: tab control for VB6

    Hello Eduardo!

    Your reply has shown me the possibility and hope. Time is not a problem, you can do it at any convenient time for you. I hope to see the release of this example in the near future.

    Thank you very much!

  20. #100
    Addicted Member
    Join Date
    Feb 2022
    Posts
    189

    Re: NewTab: tab control for VB6

    Quote Originally Posted by smileyoufu View Post
    ... I hope to see the release of this example in the near future.
    Just an idea, but a picturebox has virtually all the capabilities of a form. So maybe instead of showing a form in each tab, you could use picBox2, picBox3, etc. to hold all the controls that would've been on Form2, Form3, etc.

  21. #101

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    To do it automatically I'll have to expand the TDIMode property from a boolean to an enum like ntTDINone, ntTDIControls and ntTDIForms.
    FYI: I have it already almost working.

  22. #102
    Lively Member
    Join Date
    Oct 2014
    Posts
    102

    Re: NewTab: tab control for VB6

    Hello Taishan!

    Thank you for your reply.

    Within a limited range of controls, it is possible to use Pic1, Pic2, and Pic3 to accommodate a limited number of controls (implemented by tab effects), or even place the control directly in the control's tab without Pic.

    In actual business, we may have many forms, and we may need to open several different forms to comprehensively process the information of different forms to complete our work (sometimes, we may need to view several different forms at the same time, constantly switching between tabs), which is why we have the idea of "tab based forms".

    There is no "tabbed form" feature in VB6, and it would be great if this feature could be achieved through tab controls.



    Similar to the "tab form" effect in Access, as shown in the screenshot below:

    Name:  Tab1.jpg
Views: 344
Size:  28.1 KB

    Name:  Tab2.jpg
Views: 350
Size:  33.9 KB

  23. #103
    Lively Member
    Join Date
    Oct 2014
    Posts
    102

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    FYI: I have it already almost working.
    The action is really swift, this is good news, wait for good news. Thank you very much!

  24. #104

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    I agree that to have the whole program with all the code and all the controls over an unique form, could be a mess for most programs.

    I have it already "working".
    I've already done the 90%, now I'm working in the other 90% ( Tom Cargill's rule).

  25. #105
    Addicted Member gilman's Avatar
    Join Date
    Jan 2017
    Location
    Bilbao
    Posts
    180

    Re: NewTab: tab control for VB6

    Quote Originally Posted by smileyoufu View Post
    Hello Taishan!

    Thank you for your reply.

    Within a limited range of controls, it is possible to use Pic1, Pic2, and Pic3 to accommodate a limited number of controls (implemented by tab effects), or even place the control directly in the control's tab without Pic.

    In actual business, we may have many forms, and we may need to open several different forms to comprehensively process the information of different forms to complete our work (sometimes, we may need to view several different forms at the same time, constantly switching between tabs), which is why we have the idea of "tab based forms".

    There is no "tabbed form" feature in VB6, and it would be great if this feature could be achieved through tab controls.



    Similar to the "tab form" effect in Access, as shown in the screenshot below:

    Name:  Tab1.jpg
Views: 344
Size:  28.1 KB

    Name:  Tab2.jpg
Views: 350
Size:  33.9 KB
    You can use the a picture to contain the entire form, you can see this sample from elGuille https://www.elguille.info/vb/API/DockVBSetParent.htm.
    The only problem is that the form that contains the NewTab control, can not be show as modal

  26. #106

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Update released.

    TDIMode now can be set to ntTDIModeForms. It works similar to an MDI form but tabbed.
    Of course, the forms don't need to be MDIChild but normal.
    There is a new sample project for testing this feature in the download.

    Please test and report back.

    Name:  TDIFormsTest.jpg
Views: 293
Size:  12.3 KB

  27. #107
    Addicted Member gilman's Avatar
    Join Date
    Jan 2017
    Location
    Bilbao
    Posts
    180

    Re: NewTab: tab control for VB6

    I downloaded the latest version and found a small bug:

    In the file NewTab.ctl the line 13763, method TDIPutFormIntoTab:

    Set TabPicture(mTabs - 1) = LoadPicture("D:\Programas\Infotambo\Iconos e imagenes\Formularios\frmAnimales\1.bmp") ' CreatePicture(iIconHandle, vbPicTypeIcon)

    Returns the error:

    Run.time error '76'
    Path not found: 'D:\Programas\Infotalambo\Iconos e imagenes\Formularios\frmAnimales\1.bmp'

    I think it should be deleted.

    Otherwise it seems to work correctly.

    Now I'm trying to resolve a small incompatibility with my method to simulate Anchor in forms automatically

  28. #108
    Fanatic Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    515

    Re: NewTab: tab control for VB6

    Everything works perfectly except post #107.
    Add that, loading the form, it does not lose focus.

  29. #109
    Lively Member
    Join Date
    Oct 2014
    Posts
    102

    Re: NewTab: tab control for VB6

    Eduardo, hello!

    Thank you for implementing the "TabForm" feature so quickly. This has provided me with great help in my work. Thank you very much!

    The feedback on the testing situation is as follows:

    1. The same error occurred as # 107; As shown in the following figure:

    Name:  Err1.jpg
Views: 287
Size:  35.8 KB

    2.When the value of Form.BorderStyle is set to 0-None, the form cannot be opened in TDIForms, but appears outside the form to open. I don't know if this is wrong; As shown in the following figure:
    Name:  Err2.jpg
Views: 292
Size:  25.5 KB

    Name:  Err3.jpg
Views: 278
Size:  11.8 KB

  30. #110

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Thanks, I deleted that line that I left when I was testing things and now the project and ocx are updated.

    Quote Originally Posted by yokesee View Post
    Add that, loading the form, it does not lose focus.
    I don't know what that means. Please explain.

    PS: fixed also an issue: the caption of the main form became deactivated when a TDI child form was activated.

  31. #111
    Lively Member
    Join Date
    Oct 2014
    Posts
    102

    Re: NewTab: tab control for VB6

    Hello Eduardo!

    Test report:

    1. Step 1) Click on the "Show Form1" form to load; Step 2) Click the "Minimize" button in the upper right corner of the form frmTDIFormsTest, and the error "Real time error 5: Invalid procedure call or parameter" will appear.



    Name:  Err4.jpg
Views: 269
Size:  10.6 KB

    Name:  Err5.jpg
Views: 278
Size:  34.2 KB

    2. Click the button "Show Form0->BorderStyle=0" in the attachment, and the form will not be loaded into "TDI". When setting "Form. BorderStyle=0", the form cannot be loaded into "TDI". It must be set to a value other than 0 to load the form into "TDI". Please advise.
    Name:  Err6.jpg
Views: 270
Size:  15.9 KB
    TDIForms test_Form0-BorderStyle = 0.zip

    Thank you very much!

  32. #112
    Lively Member
    Join Date
    Oct 2014
    Posts
    102

    Re: NewTab: tab control for VB6

    Quote Originally Posted by gilman View Post
    You can use the a picture to contain the entire form, you can see this sample from elGuille https://www.elguille.info/vb/API/DockVBSetParent.htm.
    The only problem is that the form that contains the NewTab control, can not be show as modal
    Hello, Gilman!

    Thank you for your reply and help. The information you provided has been very helpful to me and has allowed me to learn a lot of new knowledge.

    Thank you very much!

  33. #113

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Update released.

    Quote Originally Posted by smileyoufu View Post
    Hello Eduardo!

    Test report:

    1. Step 1) Click on the "Show Form1" form to load; Step 2) Click the "Minimize" button in the upper right corner of the form frmTDIFormsTest, and the error "Real time error 5: Invalid procedure call or parameter" will appear.
    Yes, thanks, that is fixed now.

    Quote Originally Posted by smileyoufu View Post
    Name:  Err5.jpg
Views: 278
Size:  34.2 KB

    2. Click the button "Show Form0->BorderStyle=0" in the attachment, and the form will not be loaded into "TDI". When setting "Form. BorderStyle=0", the form cannot be loaded into "TDI". It must be set to a value other than 0 to load the form into "TDI". Please advise.
    Name:  Err6.jpg
Views: 270
Size:  15.9 KB
    TDIForms test_Form0-BorderStyle = 0.zip
    That behavior is on purpose: borderless forms, toolwindow forms and modal forms are not tabbed (non made TDI-child) on purpose. If you want a form to be shown TDI, then it needs to have a BorderStyle 1, 2 or 3.
    I added some explanation in Form4, that is a new form. Also showing a way to display forms normally (non-TDI), even when they have normal BorderStyle.

    Quote Originally Posted by smileyoufu View Post
    Thank you very much!
    You're welcome.

  34. #114
    Lively Member
    Join Date
    Oct 2014
    Posts
    102

    Re: NewTab: tab control for VB6

    Hello Eduardo!

    Thank you for your careful explanation, which has given me a deeper understanding of the functions of the "TDI" form.

    The NewTab TDI is now being used normally in my project. This has been very helpful to me.

    Thank you very much!

  35. #115
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    608

    Re: NewTab: tab control for VB6

    btw, what is "TDI“ represent?

  36. #116

  37. #117
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    608

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    thank you

  38. #118
    New Member
    Join Date
    Sep 2023
    Posts
    7

    Re: NewTab: tab control for VB6

    This is my first post on this forum. Please understand if there are language translation errors.

    I would like to greet Mr. Eduardo, and thank him for his hard work. And related to this thread, there are several questions I want to ask :

    1 - How do I arrange the text and icon to be in the middle of the CaptionBar (adjusting to the size of the CaptionBar)?

    Attachment 189550

    When the CaptionBar position is at the bottom (ssTabOrientationBottom), it seems like the text and icons don't look good.

    Attachment 189551

    2 - Is it possible to display custom tab shapes like image attachments?

    Attachment 189552

    Thanks for your answer.

  39. #119
    New Member
    Join Date
    Sep 2023
    Posts
    7

    Re: NewTab: tab control for VB6

    Hopefully this time the images can be shown. Below, I will try to attach the images again using the Insert Image tag:

    Attachment 189556

    Attachment 189557

    Attachment 189558

    Please provide instructions on how to display the images if the images above do not appear.

    Thank You.

  40. #120

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,122

    Re: NewTab: tab control for VB6

    Hello. This forum have a problem with attachments. Please edit the post and re-upload the attachments so I can see them.

Page 3 of 6 FirstFirst 123456 LastLast

Posting Permissions

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



Click Here to Expand Forum to Full Width