Private Sub NewTab1_TDIFormsShowTabIcon(ByVal TabNumber As Long, ByVal FormCaption As String, ByVal FormhWnd As Long, IconPicture As Object, IconLeftOffset As Long, IconTopOffset As Long, IconWidth As Long, IconHeight As Long, UseIconFont As Boolean, IconFont As Object, IconChar As Variant, IconColor As Long, IconColorHovered As Long, IconColorSelected As Long, NoIcon As Boolean)
UseIconFont = True
IconChar = ChrW(&H2665)
End Sub
But I see that there is an issue with the character position. I'll see to fix that and issue an update.
The issue seems to be in the Segoe MDL2 Assets font with some upper characters.
Use the IconTopOffset parameter to center the font in the position that you want in that cases.
Anyway I updated the OCX to allow to draw the character lower.
For example:
Code:
Private Sub NewTab1_TDIFormsShowTabIcon(ByVal TabNumber As Long, ByVal FormCaption As String, ByVal FormhWnd As Long, IconPicture As Object, IconLeftOffset As Long, IconTopOffset As Long, IconWidth As Long, IconHeight As Long, UseIconFont As Boolean, IconFont As Object, IconChar As Variant, IconColor As Long, IconColorHovered As Long, IconColorSelected As Long, NoIcon As Boolean)
UseIconFont = True
IconChar = &H1F9E1
IconTopOffset = -7
End Sub
IconChar is a variant that can accept the Unicode character itself like ChrW(&HE00B&), the String representation of the character number, like "&HE00B&" or the character number like &HE00B& (the long value).
IconFont is the StdFont object, passed as Object to avoid issues with typelib dependency to stdole2.tlb.
You can change the font name, size, etc.
I will read the themes with the previous property names saved.
Did you experience any issues?
After I changed the names, there were no issues that I have seen. It's probably ok to change the names. I suppose anyone that upgrades and finds their projects broken can figure out how to fix it. Chers
After I changed the names, there were no issues that I have seen. It's probably ok to change the names. I suppose anyone that upgrades and finds their projects broken can figure out how to fix it. Chers
The themes store property names.
The names of the old properties are in the themes that are saved into the themes collection property (the custom themes only).
They (the custom themes that maybe someone made) can be also saved locally from the Themes property page for to be used in other projects.
That was what I thought you were worried about. Well, that is what should be backward compatible with the old names, the saved custom themes.
Also the saved properties with old names should be read properly in the ReadProperties procedure (I also added code for that).
About the properties themselves, yes, if someone used those property names in code, she/he will have to change their names in the code. I don't think that many did, but yes, may be some.
Thanks for adding the ability to show an MDL2 Asset font as the tab Icon instead of the form Icon in TDI Mode:
Code:
Private Sub NewTab1_TDIFormsShowTabIcon( _
ByVal TabNumber As Long, _
ByVal FormCaption As String, _
ByVal FormhWnd As Long, _
ByRef IconPicture As Object, _
ByRef IconLeftOffset As Long, _
ByRef IconTopOffset As Long, _
ByRef IconWidth As Long, _
ByRef IconHeight As Long, _
ByRef UseIconFont As Boolean, _
ByRef IconFont As Object, _
ByRef IconChar As Variant, _
ByRef IconColor As Long, _
ByRef IconColorHovered As Long, _
ByRef IconColorSelected As Long, _
ByRef NoIcon As Boolean)
UseIconFont = True
IconChar = &H1F9E1
IconTopOffset = -7
End Sub
These procedure parameters are already quite numerous, but it would be great if we could add:
ByRef useFormCaption As Boolean
ByRef sFormCaption As String
or maybe add a new sub like
Code:
Private Sub NewTab1_TDIFormsShowUnicodeCaption( etc. )
So then we could replace the limitations of showing Unicode chars in the form Caption, and the sFormCaption could replace the tab caption with Unicode chars. Especially helpful if the form caption is translated to a different language at runtime.
Cheers
Last edited by taishan; Jan 3rd, 2025 at 02:39 AM.
In the TDIBeforeNewTab event you can change the tab Caption.
Not sure if it would be a good idea to allow to change the caption here in the TDIFormsShowTabIcon event too, since there is already a FormCaption parameter, read only, that comes with the original form caption, without "(2)", "(3)" at the end, so it is not always the tab caption and could not be used for changing it.
It depends on how you are going to identify the forms.
Originally Posted by taishan
Can you give me an example?
Thanks
Based on its previous caption:
Code:
Private Sub NewTab1_TDIBeforeNewTab(ByVal TabType As NewTabCtl.NTTDINewTabTypeConstants, ByVal TabNumber As Long, TabCaption As String, LoadControls As Boolean, Cancel As Boolean)
If TabCaption = "Form2" Then
TabCaption = "New caption " & ChrW(&H2665)
End If
End Sub
Last edited by Eduardo-; Jan 3rd, 2025 at 11:23 PM.
Thanks! Is there a way to update the caption of a tab after it has been loaded?
This will allow the user to change the language of the UI (English to Chinese, etc.) at runtime, and not have to restart the app.
Cheers
Thanks! Is there a way to update the caption of a tab after it has been loaded?
This will allow the user to change the language of the UI (English to Chinese, etc.) at runtime, and not have to restart the app.
Cheers
You can change the tab captions normally, as in non TDI mode:
Excellent. Thank you Eduardo for all of your hard work on this control.
Have you tested it in TwinBasic?
Cheers
I know that Wayne has been fixing things in tB to make it work, even in 64 bits, but I could not connect to Discord to see in the last days because where I am I don't have the Discord login details.
Hi Eduardo, thank you for your efforts, it would be great if you could add the ribbon to the menu.
I'm using html for the ribbon as well as NewTab, but it's getting too complicated and inconsistent, it would be great if both were in NewTab.
This is a suggestion if you have time to work on it
Last edited by Mojtaba; Jan 16th, 2025 at 07:14 AM.
Hi Eduardo, thank you for your efforts, it would be great if you could add the ribbon to the menu.
I'm using html for the ribbon as well as NewTab, but it's getting too complicated and inconsistent, it would be great if both were in NewTab.
This is a suggestion if you have time to work on it
I saw it today, but it was complicated to add items
I've used html in some cases and even flash in places to create a menu, each of which has its own problems.
In .NET and C# languages, there are very good controls in the field of toolbars and menus But vb6 is weak in my opinion
This NewTab control solved many of my problems, especially the MDI menu strip feature Just now, an idea hit me to make a ribbon with newtab
I will create a test project and put it here
Last edited by Mojtaba; Jan 16th, 2025 at 03:52 PM.
I'm not sure, I think it was: Insert Image, From URL, not checked "Retrieve locally", and I set the URL of the image in GitHub.
Every time I upload a picture, its clarity is reduced and it turns into a very low quality JPG. But your picture is either in PNG format. Online upload is also very clear, I do not know why.
Originally Posted by smileyoufu
Hello Eduardo!
Thank you for your quick response, and for helping me!
1. The new version is tested normally and has been used in my project, which solves the problem in the project and helps me a lot. Thank you very much!
2. Regarding the value of "TabKey", my personal suggestion is that it should have "uniqueness (there should be no duplicate values)"
3. For example, the "Key" value in the "ToolBar or TabStrip" property page can not be filled, if filled, the filled "Key" value is not allowed to be repeated, as shown in the screenshot below.
Thank you very much!
It is very convenient to switch automatically through key search.
The.net framework, TreeView control, one with only the title text. However, the text of each item may be duplicated, so the search can not be accurately located.Then I wrote a lot of code to loop through each item. It is also convenient to use a unique numeric ID or key to locate directly.
Last edited by xiaoyao; Jan 24th, 2025 at 05:05 AM.
Every time I upload a picture, its clarity is reduced and it turns into a very low quality JPG. But your picture is either in PNG format. Online upload is also very clear, I do not know why.
Hi Eduardo, the new update has a problem in the form section
When you open the form as vbModal, the form does not open independently and opens in the same tab
The latest update on GitHub has this problem, previous versions did not have this problem
-------------------------------------------------------------------------------------------------------
And another problem that exists at the beginning of the movie is the closing of the main page tab.
When you close another tab and double-click, the main page is also closed and nothing remains.
Last edited by Mojtaba; Jan 26th, 2025 at 09:44 AM.
I can't recreate that one. Could you make a sample project?
This happens when we have two or more tabs and we move to the home tab and other tabs several times and close the tabs, it happens and the home tab is also closed.
Move between the home tab and form 2 a couple of times, then close form 2 and click again in the same place where you closed form 2, and the home tab will also close.
--------------------------------------------
In Windows 7, the close icon is not displayed due to the lack of the correct font. What font do you use for the icons?
This problem does not exist in Windows 8, 10, 11
Last edited by Mojtaba; Jan 26th, 2025 at 11:19 AM.
Thank you, Eduardo, these two problems have been solved
I have seen these problems before, but I wanted to express all the problems in one post
Only about the X tab closing icon in Windows 7 is not displayed correctly Of course, I solved this problem by installing the SEGMDL2 font
Last edited by Mojtaba; Jan 26th, 2025 at 01:42 PM.
successful
In terms of size, X is different, it is smaller in Windows 7, but the display problem has been solved
Windows 7
Updated version of NewTab
Windows 10
Updated version of NewTab
But in the previous version, with the font installed in Windows 7 SEGMDL2, the X size is equal to the Windows 10 image..
Windows 7
Previous version of NewTab
By installing the font
Last edited by Mojtaba; Jan 26th, 2025 at 07:47 PM.
Updated again. Let's see the size of the x now.
It will still be smaller because it uses the regular 'x', but not that much smaller.
Originally Posted by Mojtaba
But in the previous version, with the font installed in Windows 7 SEGMDL2, the X size is equal to the Windows 10 image..
Windows 7
Previous version of NewTab
By installing the font
In this version also, installing the "Segoe MDL2 Assets" font in Windows 7, it should work as in Windows 10.
Isn't it working?
Updated again. Let's see the size of the x now.
It will still be smaller because it uses the regular 'x', but not that much smaller.
In this version also, installing the "Segoe MDL2 Assets" font in Windows 7, it should work as in Windows 10.
Isn't it working?
Updated NewTab Windows7
Now it's good, X size has become bigger
This is when the font is not installed
Updated NewTab Windows7 If the font is installed in Windows 7
There is no problem in other versions of Windows 8,10,11
Eduardo, I found a solution to the problem
as I said, this problem in Windows 7 is due to the lack of the Segoe MDL2 Assets font.
Well, use another font called MS Mincho. It is installed by default on all systems from XP to 11.
I put the character font X in the picture
Hello. I checked in an old machine that I have with XP and the MS Mincho font is not installed.
That image that you posted is from Windows 7 or from Windows 10?
Because it is not only if the font is installed, but also if it supports that character. You are using Unicode 2715 that is very high. In older Windows versions, the font may exists but not including the upper characters.