Nonsense. Please stop.
Printable View
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
Excellent work, thanks for the update!
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).
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:
I’ve tried also with adding tabMainForm.Redraw = True before the refresh statements. Didn’t make a difference.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
Tested in the IDE, as well as compiled on Windows 10, but unfortunately all the same.
What do I do wrong?
Thanks,
Erwin
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
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:
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.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
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).
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>
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.
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
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.
Attachment 189396
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:
Attachment 189453
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.
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!
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:
Attachment 189462
Attachment 189463
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).
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
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.
Attachment 189490
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
Everything works perfectly except post #107.
Add that, loading the form, it does not lose focus.
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:
Attachment 189499
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:
Attachment 189500
Attachment 189501
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.
Attachment 189507
Attachment 189508
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.
Attachment 189509
Attachment 189510
Thank you very much!
Update released.
Yes, thanks, that is fixed now.
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.
You're welcome.
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!
btw, what is "TDI“ represent?
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.
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.
Hello. This forum have a problem with attachments. Please edit the post and re-upload the attachments so I can see them.