The Windows color dialog seems a bit outdated to me. Here is a new one that can replace it.
The currently supported languages are: English, Spanish, Chinese, Italian, Greek, French (thanks Crapahute), German, Portuguese and Russian. Non-supported locales default to English.
The texts that need to be translated for other languages are in the mUILocalization bas module:
Code:
' Microsoft teminology search: https://www.microsoft.com/en-us/language/search
Select Case TextID
Case cdUIT_frmColorDialog_Form_Caption ' English: "Color selection"
Text = "Color selection"
Case cdUIT_ColorSelector_chkFixedPalette_Caption ' English: "Fixed"
Text = "Fixed"
Case cdUIT_ColorSelector_chkFixedPalette_ToolTipText ' English: "Reflects color changes visually in the palette or not"
Text = "Reflects color changes visually in the palette or not"
Case cdUIT_ColorSelector_cboSliderParameter_ToolTipText ' English: "Slider control parameter"
Text = "Slider control parameter"
Case cdUIT_ColorSelector_lblMode_Caption ' English: "Mode:"
Text = "Mode:"
Case cdUIT_ColorSelector_cboSliderParameter_ListItem_Hue ' English: "Hue"
Text = "Hue"
Case cdUIT_ColorSelector_cboSliderParameter_ListItem_Luminance ' English: "Lum."
Text = "Lum."
Case cdUIT_ColorSelector_cboSliderParameter_ListItem_Value ' English: "Value"
Text = "Value"
Case cdUIT_ColorSelector_cboSliderParameter_ListItem_Saturation ' English: "Sat."
Text = "Sat."
Case cdUIT_ColorSelector_cboSliderParameter_ListItem_Red ' English: "Red"
Text = "Red"
Case cdUIT_ColorSelector_cboSliderParameter_ListItem_Green ' English: "Green"
Text = "Green"
Case cdUIT_ColorSelector_cboSliderParameter_ListItem_Blue ' English: "Blue"
Text = "Blue"
Case cdUIT_ColorSelector_cboColorSystem_ListItem_HSV ' English: "HSV"
Text = "HSV"
Case cdUIT_ColorSelector_cboColorSystem_ListItem_HSL ' English: "HSL"
Text = "HSL"
Case cdUIT_frmColorDialog_lblBasicColors_Caption ' English: "Basic colors:"
Text = "Basic colors:"
Case cdUIT_frmColorDialog_lblRecent_Caption ' English: "Recent:"
Text = "Recent:"
Case cdUIT_frmColorDialog_Color_Caption ' English: "color"
Text = "color"
Case cdUIT_frmColorDialog_ColorNew_Caption ' English: "new"
Text = "new"
Case cdUIT_frmColorDialog_ColorPrevious_Caption ' English: "previous"
Text = "previous"
Case cdUIT_frmColorDialog_MouseWheel_ToolTipStart ' English: "Hold down the Control key to change"
Text = "Hold down the Control key to change"
Case cdUIT_frmColorDialog_MouseWheel_ToolTipEnd ' English: "with the mouse wheel, press Shift key to go slowly"
Text = "with the mouse wheel, press Shift key to go slowly"
Case cdUIT_frmColorDialog_EyeDropper_ToolTip ' English: "Choose a color from anywhere on the screen or press the Escape key to cancel"
Text = "Choose a color from anywhere on the screen or press the Escape key to cancel"
Case cdUIT_frmColorDialog_picEyeDropper_ToolTipText ' English: "Choose a color from the screen"
Text = "Choose a color from the screen"
Case cdUIT_frmColorDialog_lblRed_Caption ' English: "Red:"
Text = "Red:"
Case cdUIT_frmColorDialog_lblGreen_Caption ' English: "Green:"
Text = "Green:"
Case cdUIT_frmColorDialog_lblBlue_Caption ' English: "Blue:"
Text = "Blue:"
Case cdUIT_frmColorDialog_lblHex_Caption ' English: "Hex:"
Text = "Hex:"
Case cdUIT_frmColorDialog_lblHue_Caption ' English: "Hue:"
Text = "Hue:"
Case cdUIT_frmColorDialog_lblSaturation_Caption ' English: "Sat.:"
Text = "Sat.:"
Case cdUIT_frmColorDialog_Luminance_Caption ' English: "Lum.:"
Text = "Lum.:"
Case cdUIT_frmColorDialog_Value_Caption ' English: "Value:"
Text = "Value:"
Case cdUIT_frmColorDialog_lblColorSystem_Caption ' English: "Mode:"
Text = "Mode:"
Case cdUIT_frmColorDialog_lblPalette_Caption ' English: "Palette:"
Text = "Palette:"
Case cdUIT_frmColorDialog_cboPalette_ListItem1 ' English: "Wheel, fixed"
Text = "Wheel, fixed"
Case cdUIT_frmColorDialog_cboPalette_ListItem2 ' English: "Box, fixed"
Text = "Box, fixed"
Case cdUIT_frmColorDialog_cboPalette_ListItem3 ' English: "Wheel, dynamic"
Text = "Wheel, dynamic"
Case cdUIT_frmColorDialog_cboPalette_ListItem4 ' English: "Box, dynamic"
Text = "Box, dynamic"
Case cdUIT_frmColorDialog_InvalidColorMessage ' English: "The color is not valid."
Text = "The color is not valid."
Case cdUIT_frmColorDialog_ParameterFullName_Hue ' English: "Hue"
Text = "Hue"
Case cdUIT_frmColorDialog_ParameterFullName_Luminance ' English: "Luminance"
Text = "Luminance"
Case cdUIT_frmColorDialog_ParameterFullName_Saturation ' English: "Saturation"
Text = "Saturation"
Case cdUIT_frmColorDialog_ParameterFullName_Red ' English: "Red"
Text = "Red"
Case cdUIT_frmColorDialog_ParameterFullName_Green ' English: "Green"
Text = "Green"
Case cdUIT_frmColorDialog_ParameterFullName_Blue ' English: "Blue"
Text = "Blue"
Case cdUIT_frmColorDialog_ParameterFullName_Value ' English: "Value"
Text = "Value"
Case cdUIT_frmColorDialog_OK ' English: "OK"
Text = "OK"
Case cdUIT_frmColorDialog_Cancel ' English: "Cancel"
Text = "Cancel"
Case cdUIT_frmColorDialog_Close ' English: "Close"
Text = "Close"
End Select
Last edited by Eduardo-; Sep 14th, 2022 at 10:41 AM.
To be done correctly (multi-lingual), the control would need to make a call to the GetUserDefaultUILanguage API, and adjust accordingly. But I suspect Eduardo knows that.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
To be done correctly (multi-lingual), the control would need to make a call to the GetUserDefaultUILanguage API, and adjust accordingly. But I suspect Eduardo knows that.
Update released: added Unicode support for captions and Chinese language.
Also several improvements and bug fixes.
If you are native Chinese please take a look specially to the longer phrases and report any error, thanks.
Public Sub SetCompact(Optional RecentColorsColumns As Long = 0, Optional ColorValuesSectionVisible As Boolean = False, Optional SliderOptionsAvailable As CDSliderOptionsAvailableConstants = cdSliderOptionsNone, Optional nDialogCaptionVisible As Boolean = True, Optional nConfirmationButtonsVisible As Boolean = True, Optional nColorSelectionBoxVisible As Boolean = True, Optional nSliderWide As CDYesNoAutoConstants = cdYNAuto, Optional nHideLabels As Boolean = False)
mDlg.SetCompact RecentColorsColumns, ColorValuesSectionVisible, SliderOptionsAvailable, nDialogCaptionVisible, nConfirmationButtonsVisible, nColorSelectionBoxVisible, nSliderWide, nHideLabels
End Sub
Did you make any change? Do you have SP6 installed?
Try closing the IDE and opening the project group again. Did still happen?
Anyone else experience the issue?
Public Sub SetCompact(Optional RecentColorsColumns As Long = 0, Optional ColorValuesSectionVisible As Boolean = False, Optional SliderOptionsAvailable As CDSliderOptionsAvailableConstants = cdSliderOptionsNone, Optional nDialogCaptionVisible As Boolean = True, Optional nConfirmationButtonsVisible As Boolean = True, Optional nColorSelectionBoxVisible As Boolean = True, Optional nSliderWide As CDYesNoAutoConstants = cdYNAuto, Optional nHideLabels As Boolean = False)
mDlg.SetCompact RecentColorsColumns, ColorValuesSectionVisible, SliderOptionsAvailable, nDialogCaptionVisible, nConfirmationButtonsVisible, nColorSelectionBoxVisible, nSliderWide, nHideLabels
End Sub
Microsoft Visual Basic
Compile Error:
Circular correlation between modules
OK help
Similar problems elsewhere
i may found why have this error
---------------------------
Microsoft Visual Basic
---------------------------
模块之间循环相关
---------------------------
确定 帮助
---------------------------
ColorControlsConstants.CLS contains custom enumeration types that are referenced in user controls. An error will occur. . . And the ide is just a prompt, it doesn't show which line of code is wrong,If modified to .BAS module. Can't use custom enum variables
why do i have this problem ,how can fixed?
cannot reference OLEGuids.tlb
Reference=*\G{5B1EACE0-EDEB-11E1-AFF1-0800200C9A66}#1.0#0#OLEGuids\OLEGuids.tlb#OLE Guid and interface definitions
NOW WORK OK...
Another problem is that the ocx version cannot be registered. and include your new version of bsprintER.OCX
Last edited by xxdoc123; Sep 13th, 2022 at 04:34 AM.
If modified to .BAS module. Can't use custom enum variables
Of course, that's why I put them in a class module. They need to be public (to be used outside the ocx).
Originally Posted by xxdoc123
why do i have this problem ,how can fixed?
cannot reference OLEGuids.tlb
Reference=*\G{5B1EACE0-EDEB-11E1-AFF1-0800200C9A66}#1.0#0#OLEGuids\OLEGuids.tlb#OLE Guid and interface definitions
NOW WORK OK...
You must have another version registered of OLEGuids.tlb
Well, I unticked from References OLEGuids, and I started to get all the problem that you say of "circular references".
The version that I used of Krool controls is not the latest, I used a version where already had those controls separated, that were the ones I needed also here, so the version of OLEGuids.tlb is not the latest either.
Originally Posted by xxdoc123
Another problem is that the ocx version cannot be registered. and include your new version of bsprintER.OCX
I cannot find any kind of reference to BSPrinter in the entire project.
Further on, I unregistered BSPrint10.ocx in my machine, and I could use ClrCtrl2.ocx with no issue.
Where do you see a reference to BSPrinter?
As I said, there is no reference to BSPrinter anywhere.
The reason why you cannot register the OCX might be because you made some compilation and deleted the OCX file, but didn't unregister it first.
I updated the project now, there are two test projects, one for compiled and one for source code.
I also added a couple of bat files to register and unregister the OCX easily.
For your current issue, maybe you'll have to clean the registry manually (if you don't have the deleted OCX any more to unregister it).
I checked and the OLEGuids.tlb file that I'm using is the latest available already.
This happens because you have the OLEGuids.tlb typelid registered and it is in some particular folder, but VB looks for it in Windows/System (Windows/SysWOW64) and can't find it.
If yuo open the References window you'll see:
You need to untick that and to navigate to where you actually have the file and select it.
Or to avoid such issues use the compiled ocx.
Last edited by Eduardo-; Sep 14th, 2022 at 07:25 AM.
Changed the location of OLEGuids.tlb, now it is expected to be under Windows / System (SysWOW64).
To avoid the problem that some have been experiencing.
(It applies just for the source code project, but it does not apply if you use the OCX already compiled).
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
You can see example uses in the test project of the download.
I downloaded the test project and was playing around. The first thing I noticed is that the "cross hairs" that show where you are in the color circle disappears if I hold the left mouse button down and drag around the circle.
It *does* appear to follow the mouse around and change the color, but the cross hairs don't get redrawn until I let go of the mouse button.
Just letting you know... otherwise, another very cool control. Hopefully I'll drop it into my project shortly.
That behavior was on purpose, copied from the standard Windows color dialog.
I think the idea was that if you have the mouse pressed, you can see what color you are pointing by the mouse pointer.
Anyway I changed it to be always visible to match the new color dialog that comes with Paint in Windows 11.
I also added a new property "PointerType" with the option to be a circle or cross-hair, now the circle is the default, similar to Windows 11 Paint's color dialog.
Last edited by Eduardo-; May 20th, 2023 at 02:37 AM.
That behavior was on purpose, copied from the standard Windows color dialog.
I think the idea was that if you have the mouse pressed, you can see what color you are pointing by the mouse pointer.
Anyway I changed it to be always visible to match the new color dialog that comes with Paint in Windows 11.
I also added a new property "PointerType" with the option to be a circle or cross-hair, now the circle is the default, similar to Windows 11 Paint's color dialog.
Very nice! I'll download the update and try it out!
While I have you, is there a way to get the "themed" command buttons (just like the ones at the bottom of the dialog) into my VB6 project? It would be neat to modernize my app a little with these.
Very nice! I'll download the update and try it out!
While I have you, is there a way to get the "themed" command buttons (just like the ones at the bottom of the dialog) into my VB6 project? It would be neat to modernize my app a little with these.
Yes, of course, you need to add a manifest to the exe file as resource #24.
You can search the forum about how to do this or post a question in the general section for recommendations, since there are several ways to deal with it.
Or just include the file attached as resource file.
You'll need to compile the program to see the themed commandbuttons, unless you want to also add the manifest to the VB6.exe.