Page 7 of 8 FirstFirst ... 45678 LastLast
Results 241 to 280 of 291

Thread: NewTab: tab control for VB6

  1. #241

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    In TDI mode, it would be helpful to have a ntFindTabFormhWnd in Enum NTFindTabMethodConstants.
    Cheers
    There are two functions:

    TDIGetTabByFormHwnd
    TDIGetFormHwndByTab

  2. #242

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    You can do it in the TDIFormsShowTabIcon event:

    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 = 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.

  3. #243
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    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

  4. #244
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    I will need a minimum sample project that reproduces the issue.
    I cannot reproduce it with a new project, so the problem must be in my code. thanks

  5. #245

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    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.

  6. #246
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    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.

  7. #247

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    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.

  8. #248
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    In the TDIBeforeNewTab event you can change the tab Caption.
    That's great news. What would be the best way to do this? Can you give me an example?
    Thanks

  9. #249

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    What would be the best way to do this?
    Thanks
    It depends on how you are going to identify the forms.

    Quote Originally Posted by taishan View Post
    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

  10. #250
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    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

  11. #251

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    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:

    Code:
    NewTab1.TabCaption(1) = "New caption"

  12. #252
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    Excellent. Thank you Eduardo for all of your hard work on this control.
    Have you tested it in TwinBasic?
    Cheers

  13. #253

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    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.

  14. #254
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    https://github.com/twinbasic/twinbasic/releases
    maybe check there to download the latest version, new major update 12 hours ago...
    Cheers

  15. #255

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Hello, Wayne already imported it and it is available as a package (experimental).

  16. #256
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    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

    Name:  ribbon.png
Views: 508
Size:  12.9 KB
    Last edited by Mojtaba; Jan 16th, 2025 at 07:14 AM.

  17. #257

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Mojtaba View Post
    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

    Name:  ribbon.png
Views: 508
Size:  12.9 KB
    Hello Mojtaba, have you seen this project?: [VB6/Win7+] Using the Windows UI Ribbon Framework

  18. #258
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    Hello Mojtaba, have you seen this project?: [VB6/Win7+] Using the Windows UI Ribbon Framework
    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.

  19. #259
    PowerPoster
    Join Date
    Jan 2020
    Posts
    4,973

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    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.

    Quote Originally Posted by smileyoufu View Post
    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.

  20. #260

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by xiaoyao View Post
    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.
    Post questions about the forum here.

  21. #261
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    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.

  22. #262

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Hello Mojtaba, OK, please test now.

  23. #263
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    Hello Mojtaba, OK, please test now.
    vbModal problem solved
    But the problem of closing the home tab still exists

  24. #264

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Mojtaba View Post
    But the problem of closing the home tab still exists
    I can't recreate that one. Could you make a sample project?

  25. #265
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    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
    Name:  closex.jpg
Views: 310
Size:  17.6 KB
    Attached Files Attached Files
    Last edited by Mojtaba; Jan 26th, 2025 at 11:19 AM.

  26. #266

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    OK, thanks. Please test now.

  27. #267
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    OK, thanks. Please test now.
    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

    Name:  closex.jpg
Views: 310
Size:  17.6 KB

    Name:  newX.jpg
Views: 289
Size:  17.5 KB
    Attached Files Attached Files
    Last edited by Mojtaba; Jan 26th, 2025 at 01:42 PM.

  28. #268

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    OK, I see the issue. I'll study it later or tomorrow.

  29. #269

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Updated. Please test now.

  30. #270
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    Updated. Please test now.
    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
    Name:  win7.jpg
Views: 226
Size:  17.7 KB

    Windows 10
    Updated version of NewTab
    Name:  win10.jpg
Views: 229
Size:  14.5 KB

    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
    Name:  newX.jpg
Views: 289
Size:  17.5 KB
    Last edited by Mojtaba; Jan 26th, 2025 at 07:47 PM.

  31. #271

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    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.


    Quote Originally Posted by Mojtaba View Post
    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
    Name:  newX.jpg
Views: 289
Size:  17.5 KB
    In this version also, installing the "Segoe MDL2 Assets" font in Windows 7, it should work as in Windows 10.
    Isn't it working?

  32. #272
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    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

    Name:  mnu.jpg
Views: 137
Size:  17.2 KB

    Updated NewTab Windows7
    If the font is installed in Windows 7

    Name:  newX.jpg
Views: 289
Size:  17.5 KB

    There is no problem in other versions of Windows 8,10,11

  33. #273
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    204

    Re: NewTab: tab control for VB6

    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

    Name:  MS Mincho.jpg
Views: 128
Size:  101.4 KB

  34. #274

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    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.

  35. #275
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,625

    Re: NewTab: tab control for VB6

    How about the Marlett font? The Close button icon is mapped to the "r" character:

    Name:  2025-01-27_12-13-15.jpg
Views: 64
Size:  68.2 KB

    Available since Win95:

    https://en.wikipedia.org/wiki/Marlett

  36. #276

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Ohh, I already disconnected the XP machine...
    I'll check it later. But that seems a good option, thanks jpbro.

  37. #277

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by jpbro View Post
    Name:  2025-01-27_12-13-15.jpg
Views: 64
Size:  68.2 KB
    What program do you use to draw the arrows in the image?

  38. #278
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,625

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    What program do you use to draw the arrows in the image?
    An older version of SnagIt (V11 from 2014-ish).

  39. #279

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,414

    Re: NewTab: tab control for VB6

    Quote Originally Posted by jpbro View Post
    an older version of snagit (v11 from 2014-ish).
    ok..

  40. #280

Page 7 of 8 FirstFirst ... 45678 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