Page 6 of 8 FirstFirst ... 345678 LastLast
Results 201 to 240 of 304

Thread: NewTab: tab control for VB6

  1. #201
    Lively Member
    Join Date
    Oct 2016
    Posts
    114

    Re: NewTab: tab control for VB6

    In TDI Mode how do I get the hWnd (or anything else) of the underlying form of the tab

  2. #202

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Hello, I added a TDIGetFormHwndByTab function.
    Please update to the new version.

  3. #203
    Lively Member
    Join Date
    Oct 2014
    Posts
    107

    Re: NewTab: tab control for VB6

    Hello Eduardo!
    I've been using the "NewTab" control you developed lately, it's very powerful, thank you for your efforts.
    Now there are some questions I would like to ask you how to solve:
    1. How to set the "NewTab" control property, in order to imagine the "SSTabEx" control, in the design mode, you can directly draw the required Lable, TextBox, ComboBox and other controls directly into different tabs, so as to facilitate the adjustment of the typography or set the properties of the controls in each tab, (instead of using "Move the controls to another tab" or "Move a control to this tab.") "Method);
    2. Can I add the property "Public Property TabKey(ByVal Index As Integer) As String" or "Public Property TabName(ByVal Index As Integer) As String". Tabs that are used to distinguish between different (unique names). "Index" or "TabCaption" cannot completely distinguish unique tabs, and "order" cannot be changed synchronously with the "TabCaption" value after the order is changed. In addition, you can set the value corresponding to "TabKey" or "TabName" in the property page. (Application scenario: When the software title is displayed in multiple Chinese languages, you need to assign different language characters to the "TabCaption attribute" according to the unique value "TabKey" value)
    3. If you can't add the "TabName" or "TabKey" attribute. Is it possible to add the "TabTag" and attributes to the "Property Page" so that the "Key" or "Name" value can be manually filled in to the "TabTag" at design time.
    4. In "TDI" mode, after the form is loaded, if you reset the value of "Caption" of the form, the form will be "detached" from the tab and will become a non-"TDI" form. (Application scenario: When the software title is displayed in multiple Chinese languages, the form title will be reset)
    Please help, thank you very much!



    TDIForms test_SetNewCaption.zip

    Name:  TDI.jpg
Views: 749
Size:  14.7 KB

  4. #204
    Addicted Member Mojtaba's Avatar
    Join Date
    Dec 2020
    Posts
    218

    Re: NewTab: tab control for VB6

    Quote Originally Posted by smileyoufu View Post
    Hello Eduardo!
    I've been using the "NewTab" control you developed lately, it's very powerful, thank you for your efforts.
    You can use this

    Private Sub btnSetNewCaption_Click()
    Unload Me
    Me.Caption = "New Caption"
    Me.Show
    End Sub

    Surely Eduardo has a better way

  5. #205

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Update released.

    2024-04-22 Improved in TDI mode forms when the form's caption is changed.
    2024-04-22 Added TDIGetTabByFormHwnd function.

  6. #206

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by smileyoufu View Post
    Hello Eduardo!
    I've been using the "NewTab" control you developed lately, it's very powerful, thank you for your efforts.
    Hello, thanks.

    Quote Originally Posted by smileyoufu View Post
    Now there are some questions I would like to ask you how to solve:
    1. How to set the "NewTab" control property, in order to imagine the "SSTabEx" control, in the design mode, you can directly draw the required Lable, TextBox, ComboBox and other controls directly into different tabs, so as to facilitate the adjustment of the typography or set the properties of the controls in each tab, (instead of using "Move the controls to another tab" or "Move a control to this tab.") "Method);
    I guess you must be using the control in source code, and I understand that you are asking how to change the current tab at design time (clicking the tab is disabled by default when running in source code as a protection for the subclassing).

    To turn the protection off, comment the first line: "#Const NOSUBCLASSINIDE = 1" or change the 1 by a 0.

    Or, change the current tab with the TabSel property from the property window.

    Quote Originally Posted by smileyoufu View Post
    2. Can I add the property "Public Property TabKey(ByVal Index As Integer) As String" or "Public Property TabName(ByVal Index As Integer) As String". Tabs that are used to distinguish between different (unique names). "Index" or "TabCaption" cannot completely distinguish unique tabs, and "order" cannot be changed synchronously with the "TabCaption" value after the order is changed. In addition, you can set the value corresponding to "TabKey" or "TabName" in the property page. (Application scenario: When the software title is displayed in multiple Chinese languages, you need to assign different language characters to the "TabCaption attribute" according to the unique value "TabKey" value)
    3. If you can't add the "TabName" or "TabKey" attribute. Is it possible to add the "TabTag" and attributes to the "Property Page" so that the "Key" or "Name" value can be manually filled in to the "TabTag" at design time.
    The TabTag property already exists. Its type is String.
    There is also another multipurpose property, it is TabData. Its type is Long.

    You can use any of these properties for storing custom data.

    Also there is a FindTab method that can be used to locate a tab by its TabTag or TabData values.


    Quote Originally Posted by smileyoufu View Post
    4. In "TDI" mode, after the form is loaded, if you reset the value of "Caption" of the form, the form will be "detached" from the tab and will become a non-"TDI" form. (Application scenario: When the software title is displayed in multiple Chinese languages, the form title will be reset)
    Please help, thank you very much!
    Fixed in the last update. Thanks for reporting.
    (Please test)

    I also added a TDIGetTabByFormHwnd method that is a companion for the TDIGetFormHwndByTab recently added.

  7. #207
    Lively Member
    Join Date
    Oct 2014
    Posts
    107

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Mojtaba View Post
    You can use this

    Private Sub btnSetNewCaption_Click()
    Unload Me
    Me.Caption = "New Caption"
    Me.Show
    End Sub

    Surely Eduardo has a better way
    Hello Mojtaba!
    Thank you so much for helping me!

  8. #208
    Lively Member
    Join Date
    Oct 2014
    Posts
    107

    Re: NewTab: tab control for VB6

    Hello Eduardo!
    1. I did use the controls in the source code. Following the method you instructed, after switching to an OCX file, you can already add controls on the various tabs.
    2. Reset the "Title" value of the form, and the form will be "detached" from the tab. After replacing the latest version of the file, the test results are used normally and the form is no longer "out of the box".
    3. Can the functions of TabTag, TabData, and TabKey be realized as shown in the red box in the screenshot below?
    Thank you very much!

    Name:  TabPag.png
Views: 705
Size:  32.0 KB

  9. #209

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Hello. There is currently no 'TabKey' property.

    About being able to set the TabTag and TabData properties at design time, I'm working in rearranging the property pages. Not sure it I'll have that finished today.

  10. #210
    Lively Member
    Join Date
    Oct 2014
    Posts
    107

    Re: NewTab: tab control for VB6

    Hello Eduardo!
    Thank you for your prompt response, and for the help you have given me!
    1. The "TabStrip" control has a "Key" attribute. It would be nice if you could implement the "TabKey" property in "NewTab", and it doesn't matter if you can't.
    2. "TabTag, TabData" can also basically replace the function of "TabKey" if it can be placed in the property page.

    Name:  TabStripKey.jpg
Views: 669
Size:  33.8 KB

    Thank you very much!

  11. #211

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Update released.

    Code:
    2024-04-24 Changed to OLE version 9.0.
    2024-04-24 Added property TabKey. That key can be used to set the current/active/selected tab with the Tab property now.
    2024-04-24 Added function GetTabOriginalIndex.
    2024-04-24 Now TabTag, TabData, TabFixedWidth and TabCustomColor properties can be set at design time.
    2024-04-24 Tabs property page split into two property pages (Icons went to a new property page).
    2024-04-24 Fixed bug in TabCustomColor property.

  12. #212

  13. #213

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Note that now it is possible to select a tab in code by its TabKey, like:

    Code:
    NewTab1.Tab = "Config"

  14. #214

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Opinion(s) wanted:
    Keys case sensitive or insensitive? In the current version they are case sensitive.

  15. #215
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,671

    Re: NewTab: tab control for VB6

    IMO case insensitive keys would be preferable (and likely to result in fewer questions/false bug reports for you). Somebody is going to accidentally type NewTab1.Tab = "config" and wonder why the tab isn't being selected.

  16. #216

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by jpbro View Post
    IMO case insensitive keys would be preferable (and likely to result in fewer questions/false bug reports for you). Somebody is going to accidentally type NewTab1.Tab = "config" and wonder why the tab isn't being selected.
    Yeah, I agree. I'll change that.
    Thank you!

  17. #217

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Update released.

    2024-04-25 TabKeys are now case insensitive.

  18. #218
    Lively Member
    Join Date
    Oct 2014
    Posts
    107

    Re: NewTab: tab control for VB6

    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!

    Name:  K2.png
Views: 662
Size:  13.2 KB

    Name:  K1.png
Views: 662
Size:  16.3 KB

  19. #219

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Yes, thanks for your testing!
    Update released. Keys now must be unique.

  20. #220
    Lively Member
    Join Date
    Aug 2023
    Posts
    119

    Re: NewTab: tab control for VB6

    Hi, a possible bug:

    I've added some labelplus controls inside a tab and the mousemove/mouseover events does not work in that labels (same code works ok if I put the controls outside the tab).

  21. #221
    Fanatic Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    663

    Re: NewTab: tab control for VB6

    NewTab is changing the colors of all the labels I place on the tab to the ForeColorTabSel color. Notice in the screenshot that the labels are blue but should be vbButtonText. I can change it to vbButtonText in the designer but when I run the code it's changed to blue again.

    Name:  NewTab changing label colors.jpg
Views: 591
Size:  18.9 KB

    I'm seeing this only with label controls (which happen to be Krool's VBCCR labels, if that matters)

  22. #222

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by AAraya View Post
    NewTab is changing the colors of all the labels I place on the tab to the ForeColorTabSel color. Notice in the screenshot that the labels are blue but should be vbButtonText. I can change it to vbButtonText in the designer but when I run the code it's changed to blue again.

    Name:  NewTab changing label colors.jpg
Views: 591
Size:  18.9 KB

    I'm seeing this only with label controls (which happen to be Krool's VBCCR labels, if that matters)
    Yes, if you use ambient, default color settings, then it will change them to the tab colors (by default).
    If you don't want that, set ChangeControls[Back|Fore]Color properties to False.

  23. #223

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by zx81sp View Post
    Hi, a possible bug:

    I've added some labelplus controls inside a tab and the mousemove/mouseover events does not work in that labels (same code works ok if I put the controls outside the tab).
    I tested with a normal label, and the MouseMove event works fine.
    Why should I think that it is a problem with NewTab?

    Did you test LabelPlus with a SSTab?

  24. #224
    Lively Member
    Join Date
    Aug 2023
    Posts
    119

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    I tested with a normal label, and the MouseMove event works fine.
    Why should I think that it is a problem with NewTab?

    Did you test LabelPlus with a SSTab?
    I'm doing more tests because sometimes works, really don't know why. The problem could be in the LabelPlus side but I have more (custom controls) with same behaviour under NewTab. Only problems with the MouseMove/MouseOver events, all other things works fine. But may be my program, let me do more tests, I'll keep you in touch.

  25. #225
    Fanatic Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    663

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    Yes, if you use ambient, default color settings, then it will change them to the tab colors (by default).
    If you don't want that, set ChangeControls[Back|Fore]Color properties to False.
    Thanks. Completely missed those properties. There are MANY properties for this wonderful control.

  26. #226

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by zx81sp View Post
    sometimes works, really don't know why.
    Check the ScaleMode of the Form (just a hunch).
    If non-Twins scalemodes cause problems, it must be an issue of those controls.

    Take into account this: NewTab does not have ScaleMode, it works always in twips no matter the ScaleMode of the form. The same as the SSTab control, and other control containers (other than the PictureBox).

  27. #227
    PowerPoster
    Join Date
    Jan 2020
    Posts
    5,042

    Re: NewTab: tab control for VB6

    Ocx project can first check (remote server file) to generate TLB, then set it to binary compatibility and select the generated OCX file.

    If you don't want to bring OCX files to others, you can refer to TLB instead. After the OCX is generated by the client computer, you can select binary compatibility to refer to the OCX.
    ---------------------------
    Activation control' VB.UserControl' failed. This control may not be compatible with your application. Make sure that the version of the control you are using is provided by your application.
    ---------------------------
    If the control is edited again, the project that references the control will be useless. What should I do?


    why use NewTab01.cmp?


    Type=Exe
    Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\SysWow64\stdole2.tlb#OLE Automation
    Object={66E63055-5A66-4C79-9327-4BC077858695}#9.0#0; NewTab01.ocx

    I CREATE NEW VB6 PROJECT ,ADD OCX,BUT GUID NOT SAME
    Object={3D29F268-3323-498B-96B7-7EC86FDA6EA8}#4.0#0; NewTab01.ocx

    YOU CAN USE ocx project for create TLB ,SO ALL project can use tlb,not ocx

    Code:
    NewTabCtl.vbp
    ServerSupportFiles=1
    CompatibleEXE32="..\test compiled ocx\NewTab01.TLB"
    it will create a tlb file for ocx
    ServerSupportFiles=1

  28. #228
    PowerPoster
    Join Date
    Jan 2020
    Posts
    5,042

    Re: NewTab: tab control for VB6

    An image on one of your forms takes up 1mb of space.
    If we can make the source code the same as the package, we can add it to different projects by connecting it once, which will be more convenient.
    Some spaces need to be initialized from submain. You can also add an interface intmain to it.

  29. #229
    PowerPoster
    Join Date
    Jan 2020
    Posts
    5,042

    Re: NewTab: tab control for VB6

    Quote Originally Posted by zx81sp View Post
    Hi Eduardo

    Is possible to use this control integrated in one project without using ocx?

    I've created a small project just for testing and adding the source code of the control (creating a group of projects), works fine in the IDE but I can't compile it since it asks for a binary compatibility file. When I setup the binary compatibility then appears some errors like "Get instruction missed..."

    OCX works fine but should be redistributed, registered...

    Thanks
    This should be able to do, very convenient.If any open source space code can be added to our program, it can also be removed.

  30. #230

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Added a MIT license to this and all my repositories on Github.

  31. #231

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Hello, major update.
    Most important changes are:
    Code:
    2024-12-29 Changed to OLE version 10.
    2024-12-29 All properties with names including 'TabSel' have been changed to 'SelectedTab' for clarity and better naming. The TabSel property is retained (hidden) for backward compatibility.
    The complete Changelog here.

  32. #232
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    Hello, major update.
    Most important changes are:
    Code:
    2024-12-29 Changed to OLE version 10.
    2024-12-29 All properties with names including 'TabSel' have been changed to 'SelectedTab' for clarity and better naming. The TabSel property is retained (hidden) for backward compatibility.
    This will break all of the previously created themes? If this is for only name clarity, it's not worth it.

    Otherwise, the .ocx should automatically update all theme properties such as these, which is specified in my Form_Load, as we cannot rely on a .frx or the controls definition section in a .frm to store theme properties, so the user can change from light to dark mode during runtime.

    Code:
    .BackColorTabSel
    .FlatBarColorTabSel
    .HighlightColorTabSel
    .HighlightModeTabSel
    Last edited by taishan; Dec 29th, 2024 at 12:18 PM.

  33. #233
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    What is the preferred method / property to show unicode chars in the tab TDI form caption?

  34. #234
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    Is there a way to substitute the tab icon (which is the form icon) with Segoe MDL2 assets font in a TDI?

  35. #235
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    I'd like to know if this is a bug or something on my end:
    When I hide controls on a TDI form at app startup, and then during runtime set them to .visible, they still will not be drawn.
    Cheers

  36. #236
    Addicted Member
    Join Date
    Feb 2022
    Posts
    217

    Re: NewTab: tab control for VB6

    In TDI mode, it would be helpful to have a ntFindTabFormhWnd in Enum NTFindTabMethodConstants.
    Cheers

  37. #237

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    This will break all of the previously created themes? If this is for only name clarity, it's not worth it.

    Otherwise, the .ocx should automatically update all theme properties such as these, which is specified in my Form_Load, as we cannot rely on a .frx or the controls definition section in a .frm to store theme properties, so the user can change from light to dark mode during runtime.

    Code:
    .BackColorTabSel
    .FlatBarColorTabSel
    .HighlightColorTabSel
    .HighlightModeTabSel
    I will read the themes with the previous property names saved.
    Did you experience any issues?

  38. #238

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    What is the preferred method / property to show unicode chars in the tab TDI form caption?
    You can show Unicode chars in a form caption like this (code in the form):

    Code:
    Private Declare Function DefWindowProcW Lib "user32" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    
    Friend Property Let CaptionW(nCaption As String)
        Const WM_SETTEXT As Long = &HC
        
        DefWindowProcW Me.hWnd, WM_SETTEXT, 0&, ByVal StrPtr(nCaption)
    End Property
    
    Friend Property Get CaptionW() As String
        Const WM_GETTEXT = &HD
        
        CaptionW = Space$(2048)
        CaptionW = Left$(CaptionW, DefWindowProcW(hWnd, WM_GETTEXT, Len(CaptionW), StrPtr(CaptionW)))
    End Property
    
    Private Sub Form_Load()
        CaptionW = "your Unicode Caption"
    End Sub
    Or you can change the caption in the TDIBeforeNewTab event.

  39. #239

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    Is there a way to substitute the tab icon (which is the form icon) with Segoe MDL2 assets font in a TDI?
    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.

  40. #240

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,436

    Re: NewTab: tab control for VB6

    Quote Originally Posted by taishan View Post
    I'd like to know if this is a bug or something on my end:
    When I hide controls on a TDI form at app startup, and then during runtime set them to .visible, they still will not be drawn.
    Cheers
    I will need a minimum sample project that reproduces the issue.

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