-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
Hello. I fixed the main issue of the positioning on resize, but regarding all the other options I'm considering what to do.
I'm thinking of limiting TDI mode and RightToLeft to Top Orientation only...
Attachment 190793
I tested it, now there is no problem
In my opinion, the two main modes are important, the other modes are not used much (left to right And right to left)
But if you have time, work on other modes as well
Thank you very much for your great work, it is very useful for me and I am going to use it in a project
-
2 Attachment(s)
Re: NewTab: tab control for VB6
Hi Eduardo, another problem that bothers me is that when I use the shell for the form, the form window is displayed in tabs.
I indicated with a red box that the window will be displayed in the leaves
If the rest of the forms were opened without a frame, would this problem be solved?
-
Re: NewTab: tab control for VB6
I have to say that I've read the above message several times and I have no idea what you are talking about. I can't understand the explanation nor the image.
Please try to explain the issue with other words. For example the phrase "when I use the shell for the form" is very disconcerting to me.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
I have to say that I've read the above message several times and I have no idea what you are talking about. I can't understand the explanation nor the image.
Please try to explain the issue with other words. For example the phrase "when I use the shell for the form" is very disconcerting to me.
I mean software skins for beautifying the form like CodJock Skinning , ...
Tools to create beautiful forms
The form is displayed as a window in the tabs
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Mojtaba
I mean software skins for beautifying the form like CodJock Skinning , ...
Tools to create beautiful forms
The form is displayed as a window in the tabs
Ahhhhh, then the TDI mode might be incompatible with CodeJock Skin component...
Or something should be made in the Skin component configuration side to avoid those issues.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
Ahhhhh, then the TDI mode might be incompatible with CodeJock Skin component...
Or something should be made in the Skin component configuration side to avoid those issues.
Unfortunately the skin is placed on all forms and the TDI mode does not work by default and is displayed as another window in the tab.
I don't know how to solve the problem.:(
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Mojtaba
Unfortunately the skin is placed on all forms and the TDI mode does not work by default and is displayed as another window in the tab.
I don't know how to solve the problem.:(
I never used CodeJock components. To find a solution would require to study the documentation of the skin component, how to avoid applying skin to certain forms or elements.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
I never used CodeJock components. To find a solution would require to study the documentation of the skin component, how to avoid applying skin to certain forms or elements.
I tried with some other tools and it was the same
If the forms that were in the open tab were without frames, I think the problem would be solved
That is, only the form page should be displayed in the sheet, not the entire window
Form2.BorderStyle = 0
Form3.BorderStyle = 0
You can test with this mode?
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Mojtaba
Form2.BorderStyle = 0
Form3.BorderStyle = 0
You can test with this mode?
To test what?
BorderStyle 0 are not treated for TDI mode (anyway I don't understand what you mean).
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
To test what?
BorderStyle 0 are not treated for TDI mode (anyway I don't understand what you mean).
Sorry, I can't explain well in English
So I have to look for another way
Thank you for your time
-
Re: NewTab: tab control for VB6
Any test that involves having the CodeJock skin component, I won't be able to perform it because I don't have it (and don't want to install it).
-
1 Attachment(s)
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
Any test that involves having the CodeJock skin component, I won't be able to perform it because I don't have it (and don't want to install it).
Hi, I solved this problem by CodeJock
-------------------------------------------
Another question, Eduardo
I want to open a form in the home tab
Can this be done ?
-
Re: NewTab: tab control for VB6
Convert your form to a user control.
If you insist in having a form in a form then use the SetParent API, but you can get strange behavior
-
Re: NewTab: tab control for VB6
Hello,
Quote:
Originally Posted by
Mojtaba
Hi, I solved this problem by CodeJock
-------------------------------------------
Great!
Quote:
Originally Posted by
Mojtaba
Another question, Eduardo
I want to open a form in the home tab
Can this be done ?
I issued an update to make this possible, please update.
Then to hide the home tab, add this line somewhere (Form_Load is a good place):
Code:
TabVisible(0) = False
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
Hello,
I issued an update to make this possible, please update.
Then to hide the home tab, add this line somewhere (Form_Load is a good place):
Code:
TabVisible(0) = False
I have done it
Great, Thank you
-
Re: NewTab: tab control for VB6
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
-
Re: NewTab: tab control for VB6
First compile the OCX to have a copy of it in order to set the binary compatibility. Then you should be able to add the .ctl file to any project without the need to distribute the OCX file.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
VanGoghGaming
First compile the OCX to have a copy of it in order to set the binary compatibility. Then you should be able to add the .ctl file to any project without the need to distribute the OCX file.
I can't compile the OCX with binary compatibility since it shows same errors like compiling it with the whole project. I've readed the thread and I guess this only will work in OCX mode :(
Thanks anyway
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
zx81sp
Hi Eduardo
Is possible to use this control integrated in one project without using ocx?
Yes, of course.
Quote:
Originally Posted by
zx81sp
I've created a small project just for testing and adding the source code of the control (creating a group of projects)
If you want to integrate this control into a standard exe project, then you don't need a project group but only the standard exe project and add all the files to it.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
if you want to integrate this control into a standard exe project, then you don't need a project group but only the standard exe project and add all the files to it.
I've tried it but doesn't work. I have a project that uses the ocx version so I've tried to add all the control files to it and remove the ocx reference, no errors in that part.
When I create a empty form and try to add a newtab control it stops in this sentence:
Attachment 191072
EDITED: I''ve found the trick. The file pagNewTabTabs is referenced to "NewTabCtl" that is the original project:
Code:
Begin NewTabCtl.NewTab NewTab1
I've changed that for my project name and all seems work fine (also changed pagNewTabThemes)
Thanks!
-
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
-
Re: NewTab: tab control for VB6
Hello, I added a TDIGetFormHwndByTab function.
Please update to the new version.
-
2 Attachment(s)
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!
Attachment 191246
Attachment 191247
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
smileyoufu
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
-
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
smileyoufu
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
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
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
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Mojtaba
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!
-
1 Attachment(s)
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!
Attachment 191275
-
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.
-
1 Attachment(s)
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.
Attachment 191301
Thank you very much!
-
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.
-
2 Attachment(s)
Re: NewTab: tab control for VB6
-
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"
-
Re: NewTab: tab control for VB6
Opinion(s) wanted:
Keys case sensitive or insensitive? In the current version they are case sensitive.
-
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
jpbro
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!
-
Re: NewTab: tab control for VB6
Update released.
2024-04-25 TabKeys are now case insensitive.
-
2 Attachment(s)
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!
Attachment 191329
Attachment 191330
-
Re: NewTab: tab control for VB6
Yes, thanks for your testing!
Update released. Keys now must be unique.
-
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).
-
1 Attachment(s)
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.
Attachment 191797
I'm seeing this only with label controls (which happen to be Krool's VBCCR labels, if that matters)
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
AAraya
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.
Attachment 191797
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
zx81sp
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?
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
zx81sp
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).
-
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
-
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
zx81sp
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.
-
Re: NewTab: tab control for VB6
Added a MIT license to this and all my repositories on Github.
-
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
Eduardo-
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
-
Re: NewTab: tab control for VB6
What is the preferred method / property to show unicode chars in the tab TDI form caption?
-
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?
-
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
-
Re: NewTab: tab control for VB6
In TDI mode, it would be helpful to have a ntFindTabFormhWnd in Enum NTFindTabMethodConstants.
Cheers
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
taishan
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?
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
taishan
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
taishan
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.
-
Re: NewTab: tab control for VB6
Quote:
Originally Posted by
taishan
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.