While doing this, I read the comments above this area:
Code:
'Tab is a reserved keyword in VB6, but you can remove that restriction.
'To be able to compile with Tab property, you need to replace VBA6.DLL with this version: https://github.com/EduardoVB/NewTab/raw/main/control-source/lib/VBA6.DLL
'VBA6.DLL is in VS6's installation folder, usually:
'C:\Program Files (x86)\Microsoft Visual Studio\VB98\
So, I did this and I have not been having as many problems as I was before... my question is: Do I have to distribute this modified VBA6.DLL to all of my users?
Everything looks and runs great in the IDE, but when I run the compiled EXE, the program immediately dies (even on the dev machine)! I need to figure out how to deploy this! Please help!
Thanks!
Last edited by BooksRUs; Jul 14th, 2023 at 12:18 PM.
my question is: Do I have to distribute this modified VBA6.DLL to all of my users?
No, you need only the modified DLL in your VB6 installation, for being able to compile using that reserved word.
The DLL is exactly the same as the original, the only difference is that 'Tab' is no longer a reserved keyword.
Originally Posted by BooksRUs
Everything looks and runs great in the IDE, but when I run the compiled EXE, the program immediately dies (even on the dev machine)! I need to figure out how to deploy this! Please help!
I have tried to figure this out on my own, but to no avail.
I ran ProcMon to possibly see what's happening. When the compiled EXE and VB6 fail, just before there is this line in the
Operation: RegOpenKey
Path: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\LanguagePack\SurrogateFallback\Segoe MDL2 Assets
Result: NAME NOT FOUND
After this it runs WerFault.exe and dies...
Perhaps there is something weird going on with the Segoe fonts that the control uses? Or something with Unicode? I have no idea, just throwing out ideas.
I hate to go backwards and have to use SSTab again, but I need to be able to get this to the users.
What Windows version are you using?
I guess it must be a problem when compiling the control on Windows7/8.
Unfortunately, I have only Windows 11 here now to be able to test that.
But then, it has nothing to do with the replacement VBA6,DLL... I guess.
Thank you once again for this pleasing and wonderful control.
In order to use the NewTab control embedded in a project (instead of as an ocx), I just adopted the following simple methodology in a new sample project (say, 'abc'):
1. I created a new folder copying the following '6 directories' alone from your "control-source" folder.
- bas
- cls
- ctl
- frm
- pag
- subclass
2. Then, I added all the files in the above folders into my sample 'abc' project. In the case of two files alone (pagNewTabTabs.pag AND pagNewTabThemes.pag), I had to first replace 'NewTabCtl' with 'abc' inside them, before including them in my project. Note: 'pagNewTabHelp.pgx' also has the word 'NewTabCtl' contained in it. I did not replace it though.
3. Now, I added one NewTab in 'Form1', started 'abc' from the IDE and it worked.
4. I created 'abc.exe' and executing it worked too, displaying the tabs in the starting screen.
5. I copy/pasted and just ran 'abc.exe' in one other occasionally used Windows10 system of mine and it worked therein too, displaying the tabs in the starting screen.
So, I believe all that is required to make your splendid 'NewTab' working embedded in a new project is, what I have done above. If I have missed any step or need to do anything more, please do let me know, when your time permits, since I am planning to use the same procedure as above, soon, to avail your NewTab in a larger project of mine, distributed to users.
Thanks a TON once again for this fantastic and beautiful control.
Kind Regards.
Edit-1: Changed 'pagNewTabHelp' to 'pagNewTabHelp.pgx' Edit-2: Changed '7 directories' to '6 directories'
Issue of primary concern to me right now --
1. After starting your sample project group "Test uncompiled.vbg", in IDE (design time), I am unable to select the individual tabs (other than 'Tab 0') and place/add controls in them. To ensure it is so, I tried running your sample in the one other system of mine too. The result is the same. Of course, the result is the same, if I create a project of my own too (like 'abc', using the steps I mentioned in my previous post and which you have okayed).
Note-1: if I start "Test with ocx compiled.vbg", therein I am able to quite easily select all the individual tabs and place/add controls in them at design time.
Note-2: By 'Tab 0', I mean the tab with caption 'Tab 0' which appears selected by default anyway, as soon a NewTab is added to a form.
--
Issues NOT of primary concern --
1. When using "Test uncompiled.vbg", after right-clicking the NewTab control (added to a form), clicking 'Properties' and selecting the 'Help' tab in the "Property Pages" screen, the 'Help' contents do not appear coherently. Also, the contents do not seem to get loaded fully.
2. Unicode texts (both caption and tooltip) not retained after close & reopen of project. All characters appear as questions marks. This issue exists in both 'Test uncompiled.vbg" and "Test with ocx compiled.vbg". If the project is compiled to an exe (with the Unicode texts), the executable exhibits Unicode text correctly for both caption and tooltip. So, right now, I am planning to manage this issue by populating the Unicode caption and tooltip texts during 'Form' Load. Any other easier way?
--
In case my above observations are incorrect, kindly let me know what I need to do to correct the issues I am facing.
General query:
To change the names of the themes, the procedure to be followed is to change their names in the bas file (mNewTabThemes). Right? I saw a theme named as 'Esmerald'. I wanted to change its name (name alone) to 'Emerald'. So, I changed "Esmerald" to "Emerald" in the 'LoadDefaultThemes' function of the aforesaid bas file. This works and I am able to see the change in the theme name effected correctly. But, hope this procedure I adopted is correct and there are no side-issues in this.
By the way, the facility to reorder the tabs at run time is great. Kudos for thinking of a feature like this in the first place.
And, I take this opportunity to once again thank you for your fabulous NewTab control.
Issue of primary concern to me right now --
1. After starting your sample project group "Test uncompiled.vbg", in IDE (design time), I am unable to select the individual tabs (other than 'Tab 0') and place/add controls in them. To ensure it is so, I tried running your sample in the one other system of mine too. The result is the same. Of course, the result is the same, if I create a project of my own too (like 'abc', using the steps I mentioned in my previous post and which you have okayed).
Note-1: if I start "Test with ocx compiled.vbg", therein I am able to quite easily select all the individual tabs and place/add controls in them at design time.
Note-2: By 'Tab 0', I mean the tab with caption 'Tab 0' which appears selected by default anyway, as soon a NewTab is added to a form.
It is a protection, so it does not crash when running uncompiled in the IDE.
You can remove it. Close the form, then open the NewTab's UserControl code window, then go to the fist line and change it to:
Code:
#Const NOSUBCLASSINIDE = 0
Originally Posted by softv
Issues NOT of primary concern --
1. When using "Test uncompiled.vbg", after right-clicking the NewTab control (added to a form), clicking 'Properties' and selecting the 'Help' tab in the "Property Pages" screen, the 'Help' contents do not appear coherently. Also, the contents do not seem to get loaded fully.
Could not reproduce this one, I see the text OK here.
Originally Posted by softv
2. Unicode texts (both caption and tooltip) not retained after close & reopen of project. All characters appear as questions marks. This issue exists in both 'Test uncompiled.vbg" and "Test with ocx compiled.vbg". If the project is compiled to an exe (with the Unicode texts), the executable exhibits Unicode text correctly for both caption and tooltip. So, right now, I am planning to manage this issue by populating the Unicode caption and tooltip texts during 'Form' Load. Any other easier way?
That's normal, The VB6 IDE cannot handle Unicode.
Yes, assign the texts in the Form_Load,
Originally Posted by softv
General query:
To change the names of the themes, the procedure to be followed is to change their names in the bas file (mNewTabThemes). Right? I saw a theme named as 'Esmerald'. I wanted to change its name (name alone) to 'Emerald'. So, I changed "Esmerald" to "Emerald" in the 'LoadDefaultThemes' function of the aforesaid bas file. This works and I am able to see the change in the theme name effected correctly. But, hope this procedure I adopted is correct and there are no side-issues in this.
No, it is OK.
Originally Posted by softv
By the way, the facility to reorder the tabs at run time is great. Kudos for thinking of a feature like this in the first place.
And, I take this opportunity to once again thank you for your fabulous NewTab control.
By the way, a label control (both intrinsic and krool's) placed inside a NewTab's tab does not display its tooltip text. The label displays it's tooltip text only if I enclose it inside a picturebox or frame control. Lack of hWnd for a label is the cause?
Well, if my above observation is correct, is there any easier way (than enclosing it inside a picturebox/frame) by which I can have the tooltip text of a label get displayed?
There seems to be a VB6 bug regarding that.
A Windowless UserControl placed inside a ControlContainer UserControl does not display the ToolTipText.
I don't think there is much we can do about that. (test project attached)
Yes, I thought something of that sort could be the case. Thanks.
Okay then, I will add a top-level picturebox/frame whenever a tab has one or more labels in it.
By the way, I observe that the tooltips of individual tabs get displayed (on mouseover) at runtime only, not at design time. If my observation is correct, is it possible to make the tabs' tooltips visible at design-time too, on mouseover?
By the way, as informed by you in post #20, I am sharing a new theme hereunder. . I included it in my code and just termed it as 'Apple Green'.
--
BackColorTabSel=16514553|BackColorTabs=15136990|FlatBarColorHighlight=3633716|FlatBarColorInactive=1 4150350|FlatBarColorTabSel=1820177|FlatBorderColor=1820177|FlatBorderMode=1|ForeColorHighlighted=167 77215|HighlightColor=3633716|HighlightEffect=0|HighlightMode=68|HighlightModeTabSel=90|IconColorTabH ighlighted=16777215|Style=3
--
The facility to so easily create new themes and also share them as easily as above is too good. Thanks a TON.
Just one query though:
'Ambient Colors' checkbox - I am unable to notice any difference in color(s) anywhere, whether it is checked or unchecked. So, I am unable to know what it actually does.
By the way, as informed by you in post #20, I am sharing a new theme hereunder. . I included it in my code and just termed it as 'Apple Green'.
--
BackColorTabSel=16514553|BackColorTabs=15136990|FlatBarColorHighlight=3633716|FlatBarColorInactive=1 4150350|FlatBarColorTabSel=1820177|FlatBorderColor=1820177|FlatBorderMode=1|ForeColorHighlighted=167 77215|HighlightColor=3633716|HighlightEffect=0|HighlightMode=68|HighlightModeTabSel=90|IconColorTabH ighlighted=16777215|Style=3
--
The facility to so easily create new themes and also share them as easily as above is too good. Thanks a TON.
Thank you! I added "Apple Green" to the default themes (it is already in the new update).
Originally Posted by softv
Just one query though:
'Ambient Colors' checkbox - I am unable to notice any difference in color(s) anywhere, whether it is checked or unchecked. So, I am unable to know what it actually does.
Kind Regards.
That is if you want to change colors that are ambient colors (or not), like vbButtonFace and vbButtonText that are the default ambient colors, or the current ambient colors in case they were changed.
If you want to adjust the other colors but not to modify these ambient colors, then the checkbox need to be not checked (is the default).
If you want to modify them anyway, then check it.
It only has effect if the theme has ambient colors in the definition.
Last edited by Eduardo-; Sep 20th, 2023 at 01:33 PM.
Great work again! I've been using the SSTabEx with great satisfaction, and just when I was looking for some capabilities that I didn't have the need for before, I discovered this new tab, which offered exactly what I was looking for. ;-)
However, I'm now running into a little challenge:
On a form I have a tab control with multiple tabs. One of the tabs has several controls on it, among others a listview. The listview is populated when the tab is selected, with a progressbar giving the user feedback on the progress.
I’ve been using the click event to initiate the population of the listview, but that results in an “unresponsive” feeling. I.e. the tab is only selected (text bold), and the controls are only displayed at the end of the event, so there is no feedback to the user. It feels like the system if frozen until the listview has been populated.
DoEvents and Refresh don't make a difference, which I guess is logic. And as far as I can see there are no “post-click” / “activate” events.
What is the best way to quickly display the tab with its controls, and once that’s done, start populating the listview?
Yes, I could add an event TabChange that would be raised after the tab already changed, but for now perhaps you could set a timer of 15 ms in the Click event.
Update released.
Added something in the Refresh method.
It turned to be that there is already an event that is raised after the tab already changed, it is named TabChange.
But, for the visual of the control to be updated, you'll need to call the Refresh method.
Why? Because the control can receive many actions, and it won't update for each one individually. So calling the Refresh method forces the visual update in that moment.
Download the latest version because I added something in the Refresh method.
Last edited by Eduardo-; Feb 3rd, 2024 at 02:24 AM.
Private Sub tabMainForm_Click(PreviousTab As Integer)
'Is here only to change the tab, allowing for a quick display of the controls, and where applicable showing the progress bar while updating the details listview
End Sub
Private Sub tabMainForm_TabSelChange()
tabMainForm.Refresh
'Rest of code
End Sub
If I comment out the call to Refresh, the tab is still redrawn.
The rest of the code
1. Resizes and relocates the controls on the tab
2. Colors a picturebox with a gradient fill, and writes a text on it
3. Fills a TreeView control
4. Fills a ListView control
During the population of the ListView, a progress bar is updated to provide feedback to the user.
Note: I'm running this in the VB6 IDE which runs in Windows XP in a virtual machine. (Oracle VM Virtual Box.)
It is the reference for binary compatibility. It is a previous version of the ocx where the file was renamed to *.cmp. VB6 takes the typelib in the ocx for reference, to make the typelib of the new file compatible.
Originally Posted by xiaoyao
whye NewTab01.ocx have 1.3MB?
VB6.EXE ONLY 1.8mb
I don't know why VB6 doesn't produce smaller binaries, but is is not a problem at all nowadays (in 99,99% of cases). If you really need smaller files, you could use UPX, it can reduce a lot the size.
Thank you! I added "Apple Green" to the default themes (it is already in the new update).
.. .. .
Sorry for the delayed response. I fell ill suddenly the Wednesday before the last (more than 2 weeks back).
While recuperating, I did see your message in my mobile and felt very happy to read the news of you having readily included the new theme (that too as "Apple Green" itself) and also pleased to see the pleasant sample image to illustrate the new theme.
Thanks for the other explanation (on 'ambient colors').
I take this opportunity to thank you once again, Eduardo, for your wonderful control.
When the user selects a tab, is there a way to know what the previous tab was? (Other than tracking it from Form load onwards in a module or global variable.)
When the user selects a tab, is there a way to know what the previous tab was? (Other than tracking it from Form load onwards in a module or global variable.)
Regards,
Erwin
In the Click event there is a PreviousTab parameter. That comes from the SSTab.
I don't know who deleted my reply.
I'm not malicious because I saw The resulting OCX file. it ended up being 1.3 MB.
If we can make it smaller, it must be a good thing.
Then I also want to analyze what is the specific problem that causes the volume to be larger?
It turned out to be because of some property pages. Because the property page is mainly used in the development and design process, it may not be needed when it is finally compiled into exe or OCX.
Then optimize it when compiling, and it will also have a certain impact according to the volume or the running speed.
With these methods, the final size was reduced by a factor of two to more than 600 KB.
I spent a few hours studying it. If you directly import multiple files of the source code into the project, which file attributes will change? Control, the public property of the class becomes private.
My idea is. The application project under development maintains an automatic reference to the files in this directory and does not need to change other settings each time a new version is downloaded.
Last edited by xiaoyao; Oct 7th, 2023 at 08:46 PM.
If different control developers can create a standard for everyone.
Some control groups contain multiple controls in one project, such as text boxes, buttons, tabs, and grid controls.
Someone may just need a text box or button that supports Unicode.
How do I keep just these two controls while deleting the other extraneous files?
I just thought of a good way The author who developed this component is most familiar with it.
Just delete some other extraneous files and then save as a project name in the same directory.
I'm writing a plug-in that will automatically bring these files into a new project.
Perhaps more than half of the users may prefer to become a stand-alone exe, because OCX requires registration and permissions.
Turn a control project into a Exe project template,You need to change the public properties of some classes or controls to private properties.Some other settings may be needed.
Then save these files with minor changes as *.-copy. CTL file name。
Because I used to test a project called exe or com DLL mode, often some files can not coexist with two projects.
Perhaps the simplest is to simply generate the OCX reference. Otherwise, it is really troublesome to add dozens of files to another new project.
It is mainly based on the fact that some control or component module projects are relatively large, with 5 to 10 or more than 20 source files.
At the same time, I would like to thank many individual developers for contributing free source code to develop more useful new controls.
And keep it updated for months to years,No matter what the return.
Because the control is very difficult to develop or change, and only the original author can implement these functions.
Last edited by xiaoyao; Oct 7th, 2023 at 09:04 PM.
Because the property page is mainly used in the development and design process, it may not be needed when it is finally compiled into exe or OCX.
Yes, they are needed for the developer using the OCX to be able to set some properties, like Theme and others, and also there are tools there that can be handy, for example to move control from one tab to another, or to change the order of tabs.
Originally Posted by xiaoyao
it will also have a certain impact according to the volume or the running speed.
I don't think so., the speed will be the same.
I'll repeat: 1.3 MB for today's standards, computers and OSs is a very small file. There is no problem at all, we are not in 1990.
Originally Posted by xiaoyao
while deleting the other extraneous files?
There are not "extraneous files", all files are needed. If you don't need some functionality then delete the corresponding files, but that won't be for everybody, other people may not want to loose the related functionality.
PD: you can delete the pagNewTabTabs property page, that one may be not needed.
ok,thank you,Maybe user want to make the volume a little smaller, and the earliest version may be smaller.
If in the process of development. Save some older versions that are more stable.
Like control version 1.0, 2.0, 3.0.
Maybe 1.0 might only be 200KB. Version 2.0 reaches 500KB, and version 3.0 reaches one megabyte.
rc3.dll,rc5.dll,rc6.dll
The old version can be easily registered on a computer, (rc6 The new version can't register on a very small number of computers (most computers will be perfectly fine))
Some people need some simple tab control functions, and it is possible that his earliest version is enough to use.
Last edited by xiaoyao; Oct 8th, 2023 at 11:40 AM.