Re: CommonControls (Replacement of the MS common controls)
Some bugs with the DTPicker:
1) The CheckBox of the DTPicker control appears too big at 120 DPI:
The other controls are from your control set too, and they display the checkbox properly.
2) The default date is not the current date.
In my user locale I have this setting: "d/m/yyyy", today it is 23/3/2022 (March 23 of 2022) and the control displays "3/ 1/2022" (January 3 of 2022)
Thanks for your work. It is becoming the default control set to use (specially for globalized programs UI, since that needs Unicode support).
Last edited by Eduardo-; Mar 23rd, 2022 at 02:54 PM.
Re: CommonControls (Replacement of the MS common controls)
In the CommonDialog object, the ShowFolderBrowser method does not show the new folder button, and there is a flag, but only to hide the button: CdlBIFNoNewFolderButton.
Re: CommonControls (Replacement of the MS common controls)
I'm using your component more and more, so I hope you don't mind if I keep reporting bugs and making suggestions.
For having full Unicode replacement, I see that the Kill Statement should be also replaced.
Code:
Private Declare Function DeleteFileW Lib "kernel32.dll" (ByVal lpFileName As Long) As Long
' (VB-Overwrite)
Public Sub Kill(ByVal sFileName As String)
If DeleteFileW(StrPtr(sFileName)) = 0 Then
Err.Raise 70
End If
End Sub
Re: CommonControls (Replacement of the MS common controls)
Hello Krool,
I am getting error 35773 with the DTPicker when trying to enter time in 24 hour format.
How can I resolve this?
Thank you!
Edit:
Ok, I found out what is happening.
The DTP was set to use DataFormat "Time"
I was setting the DTP value to TimeSerial(), but I didn't take into consideration, that TimeSerial also returns a default date of 31-12-1899, and the MinDate property wasn't set to at least that (which may be another problem - Errors out if set less)
Otherwise, for me, it works now.
Edit again:
I thought it was working, but the DTP MinDate property doesn't accept a date less than 31-12-1900.
Last edited by clintc; Mar 31st, 2022 at 05:16 AM.
I can't replicate with the OCX or std-exe. Can you bundle a demo?
Attached you will find my demo project.
How to reproduce instructions:
1. click inside the TextBoxW control
2. now click on the picture control under the TextBoxW
3. the validate event doesnt trigger and no msgbox will show up
1. click inside the VB-TextBox control
2. now click on the picture control under the VB-TextBox
3. the validate event works and a msgbox will show up
goofy:
1. click inside the TextBoxW control
2. now click inside the VB-TextBox control
3. now the validate event works and a msgbox will show up!
BTW:
i tested this inside the IDE and with a compiled exe. both the same results. tested with win7x64.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
it looks like a VB6 bug itself.
When I place a new innocent UserControl on a PictureBox it has the same issue.
Thanks for the information!
In this case the use of the validate event is complete useless...
I got some bug reports from users and never understood why!
Now i understand it, because the validation code for the textbox content was never triggered!
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by clintc
Hello Krool,
I am getting error 35773 with the DTPicker when trying to enter time in 24 hour format.
How can I resolve this?
Thank you!
Edit:
Ok, I found out what is happening.
The DTP was set to use DataFormat "Time"
I was setting the DTP value to TimeSerial(), but I didn't take into consideration, that TimeSerial also returns a default date of 31-12-1899, and the MinDate property wasn't set to at least that (which may be another problem - Errors out if set less)
Otherwise, for me, it works now.
Edit again:
I thought it was working, but the DTP MinDate property doesn't accept a date less than 31-12-1900.
The MinDate for DTP is 01-01-1900 and MaxDate is 31-12-9999.
Originally Posted by Eduardo-
Some bugs with the DTPicker:
1) The CheckBox of the DTPicker control appears too big at 120 DPI:
The other controls are from your control set too, and they display the checkbox properly.
2) The default date is not the current date.
In my user locale I have this setting: "d/m/yyyy", today it is 23/3/2022 (March 23 of 2022) and the control displays "3/ 1/2022" (January 3 of 2022)
Thanks for your work. It is becoming the default control set to use (specially for globalized programs UI, since that needs Unicode support).
1) I have no influence about the appearance on high DPI for the DTP.
That is VB.Net code. If the problem is the same one you're having then it might not even be a VB6 problem but it is instead a Windows problem, specifically a problem with the Common Controls.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
In this example, I would like to print ‘x’, ‘y’ and RichTextBox1 on the same page, but I always get ‘x’ and RichTextBox1 on one page and ‘y’ on another one.
It is as if RichTextBox1.PrintDoc fires a Printer.EndDoc even if I set CallStartEndDoc to False.
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
i have encountered some situations where case sensitive entries for Treeview were required, since they contained different data, like registry and Registry having different registry keys. This works well with the microsoft control, but not with the CCR Treeview. I am using the std exe and somehow I managed to get a working case sensitive option in the property page and the control so I am happy for now. I don't know if it could be a useful addition for other people as well.
picbox > ImageList extract to dragIcon causes black square
PROBLEM: I am populating a control's dragIcon from an MSCOMCTL imageList control but the resulting dragIcon is black when I use Krool's imageList. However, it all works fine with the MSCOMCTL imageList control.
BACKGROUND:
The source image is a PNG. The source image is written to a temporary picBox named picDragIcon using the picbox device context using GDI+, specifically, GdipDrawImageRectRectI. To accomplish this, I am using LaVolpe's C32dppDIP method to read PNGs into a VB6 picture control. In this case the picbox is merely a temporary holding control and I want to put that image into a dragIcon.
First step, I use an MSCOMCTL imageList and add the image from the temporary picbox as the sole image in the imageList.
As a result, the dragIcon shows perfectly. Why do I use an imageList? If I load the dragIcon directly from the temporary picBox as below:
Code:
picRdMap(Index).DragIcon = picDragIcon.Image ' this only works for .ico types
Then the dragIcon shows nothing, nothing at all. I think it is due to the fact that the temporary image is rendered using GDI+ or only handles .ico types. That is why I use the MSCOMCTL imageList as it somehow seems to convert the GDI+ rendered image on the picBox correctly to something the .dragIcon can use. Some sort of bitmap, anyhow, it does the job.
However, back to my problem. I want to use Krool's version of the imageList control. I prefer to use Krool's imageList as I have so far avoided using any control from MSCOMCTL instead using all of Krool's alternatives.
If I substitute Krool's imagelist the dragicon is a black square. Any ideas? I suspect this is because Krool's control is not expecting a transparent image in a standard picturebox. Any guidance would be useful.
Last edited by yereverluvinuncleber; May 29th, 2022 at 06:37 AM.
Reason: Managed to add some screenshots
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.
Re: CommonControls (Replacement of the MS common controls)
My guess is that Krool's ImageList isn't converting converting the HBITMAP to an HICON properly for this specific image. Have you tried writing your own conversion?
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Niya
My guess is that Krool's ImageList isn't converting converting the HBITMAP to an HICON properly for this specific image. Have you tried writing your own conversion?
I was hoping not to have to, hoping that the Krool version would simply provide the same conversion. I may have to do so though.
For the moment though I will stick with the MSCOMCTL version as it works. We'll just have to see if this is a bug in Krool's own imageList or missing functionality.
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.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
Re: picbox > ImageList extract to dragIcon causes black square
Originally Posted by yereverluvinuncleber
PROBLEM: I am populating a control's dragIcon from an MSCOMCTL imageList control but the resulting dragIcon is black when I use Krool's imageList. However, it all works fine with the MSCOMCTL imageList control.
BACKGROUND:
The source image is a PNG. The source image is written to a temporary picBox named picDragIcon using the picbox device context using GDI+, specifically, GdipDrawImageRectRectI. To accomplish this, I am using LaVolpe's C32dppDIP method to read PNGs into a VB6 picture control. In this case the picbox is merely a temporary holding control and I want to put that image into a dragIcon.
First step, I use an MSCOMCTL imageList and add the image from the temporary picbox as the sole image in the imageList.
As a result, the dragIcon shows perfectly. Why do I use an imageList? If I load the dragIcon directly from the temporary picBox as below:
Code:
picRdMap(Index).DragIcon = picDragIcon.Image ' this only works for .ico types
Then the dragIcon shows nothing, nothing at all. I think it is due to the fact that the temporary image is rendered using GDI+ or only handles .ico types. That is why I use the MSCOMCTL imageList as it somehow seems to convert the GDI+ rendered image on the picBox correctly to something the .dragIcon can use. Some sort of bitmap, anyhow, it does the job.
However, back to my problem. I want to use Krool's version of the imageList control. I prefer to use Krool's imageList as I have so far avoided using any control from MSCOMCTL instead using all of Krool's alternatives.
If I substitute Krool's imagelist the dragicon is a black square. Any ideas? I suspect this is because Krool's control is not expecting a transparent image in a standard picturebox. Any guidance would be useful.
Thanks for the report. I just want to test something.
Set picDragIcon.Picture = picDragIcon.Image
ImageList1.ListImages.Add , "arse", picDragIcon.Picture
If that works (if you confirm) the bugfix in the ImageList would be (in order to get your initial code to work)
Code:
Friend Sub FListImagesAdd(Optional ByVal Index As Long, Optional ByVal Picture As IPictureDisp)
...
Set UserControl.Picture = Picture
Set Picture = UserControl.Picture
Set UserControl.Picture = Nothing
...
Re: CommonControls (Replacement of the MS common controls)
Hello, Krool!
I'm trying to work with the richtext control from the replacement of the common controls, latest version.
It seems to be impossible to set the right margin so that it reflects the textwidth of a line, e.g. a right margin of 500 units should lead to a textwidth of 500 units (no left margin set), regardless of the width of the control.
But any positive value of a right margin leads to constant space between the control's right edge and the text, wrapping the text (according to the scrollbars setting).
How do I set a right margin to reflect the textwidth?
Re: CommonControls (Replacement of the MS common controls)
Krool, your workaround of using set with .picture works. The resulting image is not exactly the same but it will certainly do.
With your control the .dragIcon becomes a white box surrounding the original image, which is different but perfectly acceptable for what I want to do
The MS imageList in comparison creates a dragIcon with a transparent background in BOTH cases. I suppose (as Niya suggests) that the MS version is converting it to an HIcon.
Sorry to give you more work. At least this means I can continue to avoid using MSCOMCTL except for testing.
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by yereverluvinuncleber
Krool, your workaround of using set with .picture works. The resulting image is not exactly the same but it will certainly do.
With your control the .dragIcon becomes a white box surrounding the original image, which is different but perfectly acceptable for what I want to do
The MS imageList in comparison creates a dragIcon with a transparent background in BOTH cases. I suppose (as Niya suggests) that the MS version is converting it to an HIcon.
Sorry to give you more work. At least this means I can continue to avoid using MSCOMCTL except for testing.
You could try setting the UseMaskColor to true and set the MaskColor accordingly. (You need to check the exact RGB, probably it's only vbWhite value)
EDIT: gonna update the fix with the UserControl.Picture and Picture object swap. (to allow passing an .Image picture object)
Re: CommonControls (Replacement of the MS common controls)
I'll leave it as it is at the moment, setting the mask colour to white does the job of making the dragIcon transparent but it has side effects - other unrelated controls on the form suddenly have their mask turned off revealing the black portions of all their transparencies.
To get around this I tried enabling and disabling the use of the mask just prior to the vbBeginDrag,
ImageList1.UseMaskColor = True
- then disabling it when the vbEndDrag has done its job, it seems that UseMaskColor is not a property that can be easily be enabled at the correct points at runtime.
For the moment the white box is a usable workaround. I'll wait for any bugfix and test for you. No hurry, I have a workaround!
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.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by yereverluvinuncleber
I'll leave it as it is at the moment, setting the mask colour to white does the job of making the dragIcon transparent but it has side effects - other unrelated controls on the form suddenly have their mask turned off revealing the black portions of all their transparencies.
To get around this I tried enabling and disabling the use of the mask just prior to the vbBeginDrag,
ImageList1.UseMaskColor = True
- then disabling it when the vbEndDrag has done its job, it seems that UseMaskColor is not a property that can be easily be enabled at the correct points at runtime.
For the moment the white box is a usable workaround. I'll wait for any bugfix and test for you. No hurry, I have a workaround!
The fix is released.
You only need the MaskColor "active" during the .Add to the ImageList. So you can turn it on before, add picture to the ImageList, then turn off in the next code line.
Btw, UseMaskColor property is True by default. The MaskColor default is &HC0C0C0.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
The fix is released.
You only need the MaskColor "active" during the .Add to the ImageList. So you can turn it on before, add picture to the ImageList, then turn off in the next code line.
Btw, UseMaskColor property is True by default. The MaskColor default is &HC0C0C0.
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.
Re: CommonControls (Replacement of the MS common controls)
Okay, here I am again.
My issue about the richtext-control still is unanswered.
No hints, no solutions, no questions?
Anyone out there who uses the richtextbox and margins?
Maybe I'm using the wrong documentation, but what is the right one?
Thank's
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Seniorchef
Okay, here I am again.
My issue about the richtext-control still is unanswered.
No hints, no solutions, no questions?
Anyone out there who uses the richtextbox and margins?
Maybe I'm using the wrong documentation, but what is the right one?
Thank's
I hate this printer margin topic on the richtextbox. It was an issue already several times and I thought now it's properly done.
So, do you have a sample demo which shows the different outcomes between MS richttextbox and VBCCR richtextbox ?
Because as of now I would first suspect a mis-use in your code and not in the routine inside the richtextbox, but I could be wrong of course.
Re: CommonControls (Replacement of the MS common controls)
Hello, Krool!
I never mentioned a printer output.
For The sample, you need a form with a MSRichtext-control and a VBCCR-Richtext control with not extra settings.
Code:
Private Sub Form_Load()
With msRtf
.RightMargin = 2500
.Text = "This is a sample text in the richtext control with a right margin on "
End With
With vbRtf
.RightMargin = 2500
.Text = "This is a sample text in the richtext control with a right margin on "
End With
End Sub
Private Sub Form_Resize()
msRtf.Move 30, 30, ScaleWidth, ScaleHeight / 2
vbRtf.Move 30, ScaleHeight / 2 + 30, ScaleWidth, ScaleHeight / 2
vbRtf.Refresh
msRtf.Refresh
End Sub
Drag the window to change the width and you see the difference: the msRichtext keeps the text unchanged while the vbcontrol doesn't. The RightMargin in the MSRtf is independant from the width of the control. That's all.
My App shows text in forms that can be formatted by the user, for which purpose ever. The formatting of paragraphs should stay even after resizing the window.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Seniorchef
Hello, Krool!
I never mentioned a printer output.
For The sample, you need a form with a MSRichtext-control and a VBCCR-Richtext control with not extra settings.
Code:
Private Sub Form_Load()
With msRtf
.RightMargin = 2500
.Text = "This is a sample text in the richtext control with a right margin on "
End With
With vbRtf
.RightMargin = 2500
.Text = "This is a sample text in the richtext control with a right margin on "
End With
End Sub
Private Sub Form_Resize()
msRtf.Move 30, 30, ScaleWidth, ScaleHeight / 2
vbRtf.Move 30, ScaleHeight / 2 + 30, ScaleWidth, ScaleHeight / 2
vbRtf.Refresh
msRtf.Refresh
End Sub
Drag the window to change the width and you see the difference: the msRichtext keeps the text unchanged while the vbcontrol doesn't. The RightMargin in the MSRtf is independant from the width of the control. That's all.
My App shows text in forms that can be formatted by the user, for which purpose ever. The formatting of paragraphs should stay even after resizing the window.
Regards
I see your point. I guess that's a behavior change in the underlying richedit library. The msRichTextBox uses richedit v1.0.
I upgraded VBCCR 1.7.37 to VBCCR 1.7.38. and now i get the error message "object library not registered" when i open a VB6 project that is using the ocx.
I get the same error message when i create a complete new project at the VB6-IDE and add the VBCCR17-OCX. I can add the older VBCCR16-OCX or other OCX-files without any errors.
I tried to switch back to VBCCR 1.7.37 but it doesnt help; the error message "object library not registered" still pops up.
I tried to unregister and re-register but nothing helps.
The vb-projects-exe-files compilied with v1.7.37 are running fine with the new VBCCR 1.7.38 OCX!
But i cant open and use any of my vb-projects anymore
Re: VBCCR not work anymore after upgrading to 1.7.38
Originally Posted by Schmidt
@Krool...
I think you should look into that (since it would break also the "regfree-mode" via manifests)...
IMO, somewhere you're probably exposing a type from msdatsrc.tlb on the OCX'es Public Interface...
Olaf
Thanks for your comment.
I'm not willingly exposing it. I assume it's automagically due to DataBindingBehavior set to 1 - vbSimpleBound on some controls..
Re: CommonControls (Replacement of the MS common controls)
Dear Krool,
Warm Greetings! Happy to be writing to you again, after quite some period of time, and getting the opportunity thus to thank you once again, profoundly, for your monumental efforts.
In this post, I have attached a small project, a test app ("1. Scrollbar issues in Richtextbox.zip") to highlight two issues with scrollbars which I encountered while using the RichTextBox control.
A screenshot of the test app below, just after starting it.
A screenshot of the test app below, after clicking the two buttons in it, one after the other.
Note-1: Please do read the comments in my code, wherever they appear. Those comments are very important, as far as this 'test app' is concerned.
Note-2: The scrollbars do reappear correctly in rtb1 and rtb2 once I start scrolling the texts in them.
Note-3: In case the scrollbars do appear correctly only, at your end, always, then kindly bear with me and kindly let me know what could be the mistake I am doing at my end which makes the scrollbars disappear or get painted incompletely.
Note-4:
My vb6 IDE is themed. My OS is Windows10, 64-bit. Screen resolution is 1920*1080. Under 'Scale and Layout' in Display settings, it shows '100% (Recommended)'.
Note-5: If the above-explained issues do occur at your end too, but if they are not due to your control, then kindly let me know as to what I should do further. As of now, my own workarounds which I have mentioned (in the test app) do help solve the scrollbar issues in my projects. But then, for each RichTextBox, I need to necessarily have these workarounds.
Note-6: This is the 2nd time ever (and the first time ever, in this thread) that I am posting a project. So, if any mistake on my part in the way I have presented my project, kindly bear with me.
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
I have been away from programming for a few years and am now back. First thing I look at is your controls and of course download the latest version. I have two computers Win 10 Pro 21H2 and since I am having this problem on only one, I know the problem is at my end. I have try for a few days but no luck so maybe I try asking here.
I am getting this error (screenshot) when I tried to open any of the Forms in the Std-Exe demo. Also has this error when I try to run the demo. Any idea where I should be looking?