-
Oct 8th, 2023, 09:02 AM
#81
Re: NewTab: tab control for VB6
Originally Posted by xiaoyao
the new version is more difficult to register on a few computers.
Nonsense. Please stop.
-
Oct 8th, 2023, 11:46 AM
#82
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.
-
Oct 28th, 2023, 03:49 PM
#83
Addicted Member
Re: NewTab: tab control for VB6
Excellent work, thanks for the update!
Last edited by taishan; Oct 28th, 2023 at 03:54 PM.
-
Nov 1st, 2023, 09:23 PM
#84
Hyperactive Member
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
-
Nov 1st, 2023, 11:31 PM
#85
Re: NewTab: tab control for VB6
Originally Posted by Erwin69
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).
Last edited by Eduardo-; Nov 29th, 2023 at 10:04 AM.
-
Nov 2nd, 2023, 06:55 PM
#86
Hyperactive Member
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
-
Nov 2nd, 2023, 10:48 PM
#87
Re: NewTab: tab control for VB6
Originally Posted by Erwin69
What do I do wrong?
You told me that you didn't need to update the control:
Originally Posted by Erwin69
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.
Last edited by Eduardo-; Nov 3rd, 2023 at 04:11 AM.
-
Nov 3rd, 2023, 07:09 AM
#88
Hyperactive Member
Re: NewTab: tab control for VB6
Originally Posted by Eduardo-
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
-
Nov 3rd, 2023, 07:46 AM
#89
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?
-
Nov 3rd, 2023, 07:58 AM
#90
Hyperactive Member
Re: NewTab: tab control for VB6
Originally Posted by Eduardo-
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.
-
Nov 4th, 2023, 11:21 AM
#91
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).
-
Nov 4th, 2023, 12:04 PM
#92
Re: NewTab: tab control for VB6
Originally Posted by Erwin69
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>
-
Nov 5th, 2023, 12:19 PM
#93
New Member
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.
-
Nov 5th, 2023, 12:35 PM
#94
Re: NewTab: tab control for VB6
Originally Posted by Urba1952
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)
-
Nov 5th, 2023, 06:32 PM
#95
Hyperactive Member
Re: NewTab: tab control for VB6
Originally Posted by Eduardo-
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
-
Nov 28th, 2023, 10:39 PM
#96
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.
-
Dec 4th, 2023, 03:32 AM
#97
Lively Member
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:
-
Dec 4th, 2023, 10:45 AM
#98
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.
-
Dec 4th, 2023, 07:54 PM
#99
Lively Member
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!
-
Dec 5th, 2023, 02:42 PM
#100
Addicted Member
Re: NewTab: tab control for VB6
Originally Posted by smileyoufu
... 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.
-
Dec 5th, 2023, 02:51 PM
#101
Re: NewTab: tab control for VB6
Originally Posted by Eduardo-
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.
-
Dec 5th, 2023, 09:20 PM
#102
Lively Member
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:
-
Dec 5th, 2023, 09:23 PM
#103
Lively Member
Re: NewTab: tab control for VB6
Originally Posted by Eduardo-
FYI: I have it already almost working.
The action is really swift, this is good news, wait for good news. Thank you very much!
-
Dec 5th, 2023, 10:17 PM
#104
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).
-
Dec 7th, 2023, 04:53 AM
#105
Addicted Member
Re: NewTab: tab control for VB6
Originally Posted by smileyoufu
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:
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
-
Dec 7th, 2023, 11:16 PM
#106
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.
-
Dec 8th, 2023, 03:14 AM
#107
Addicted Member
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
-
Dec 8th, 2023, 07:20 AM
#108
Fanatic Member
Re: NewTab: tab control for VB6
Everything works perfectly except post #107.
Add that, loading the form, it does not lose focus.
-
Dec 8th, 2023, 09:04 AM
#109
Lively Member
-
Dec 8th, 2023, 09:48 AM
#110
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.
Originally Posted by yokesee
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.
Last edited by Eduardo-; Dec 8th, 2023 at 11:33 AM.
-
Dec 8th, 2023, 08:27 PM
#111
Lively Member
-
Dec 8th, 2023, 08:32 PM
#112
Lively Member
Re: NewTab: tab control for VB6
Originally Posted by gilman
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!
-
Dec 8th, 2023, 09:49 PM
#113
Re: NewTab: tab control for VB6
Update released.
Originally Posted by smileyoufu
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.
Originally Posted by smileyoufu
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.
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.
Originally Posted by smileyoufu
Thank you very much!
You're welcome.
-
Dec 10th, 2023, 08:29 PM
#114
Lively Member
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!
-
Dec 11th, 2023, 07:43 AM
#115
Fanatic Member
Re: NewTab: tab control for VB6
btw, what is "TDI“ represent?
-
Dec 12th, 2023, 01:36 AM
#116
Re: NewTab: tab control for VB6
-
Dec 12th, 2023, 05:46 PM
#117
Fanatic Member
Re: NewTab: tab control for VB6
Originally Posted by Eduardo-
thank you
-
Dec 13th, 2023, 01:32 AM
#118
New Member
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.
-
Dec 13th, 2023, 06:04 AM
#119
New Member
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.
-
Dec 13th, 2023, 08:34 AM
#120
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|