Re: CommonControls (Replacement of the MS common controls)
I start using Crool's controls, and I found some not just as I expect. Tooltips are not unicode.
In my form I use Greek letters. My VB6 IDE is in a Windows 64, Greek is primary language. Also the selectet language for VB6 IDE is Greek
So in my machine work nice, and I get greek letters for captions and tooltip. But in another machine, which have English as primary language, tooltips are saved as ANSI, and for this reason I didn't get ? characters (code 63), but the ansi numbers (from codepage for Greek letters) as in Western Europian codepage.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by georgekar
I start using Crool's controls, and I found some not just as I expect. Tooltips are not unicode.
In my form I use Greek letters. My VB6 IDE is in a Windows 64, Greek is primary language. Also the selectet language for VB6 IDE is Greek
So in my machine work nice, and I get greek letters for captions and tooltip. But in another machine, which have English as primary language, tooltips are saved as ANSI, and for this reason I didn't get ? characters (code 63), but the ansi numbers (from codepage for Greek letters) as in Western Europian codepage.
The ToolTipText property of the main object itself (VBControlExtender, e.g. CommandButtonW1.ToolTipText etc.) are the intrinsic properties by VB6 and thus ANSI.
Only ToolTipText properties in class objects (e.g. TabStrip1.Tabs(1).ToolTipText etc.) are enhanced for Unicode and also support multi-line.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
The ToolTipText property of the main object itself (VBControlExtender, e.g. CommandButtonW1.ToolTipText etc.) are the intrinsic properties by VB6 and thus ANSI.
Why dont we extend the project and add a unicode tooltiptext class and add the property ToolTipTextW to all controls?
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Mith
Why dont we extend the project and add a unicode tooltiptext class and add the property ToolTipTextW to all controls?
IMO there's no need for it.
Krool could simply implement a central Window-Creation-Hook, which reacts to the old "VB6-ToolTip-ClassName",
which then activates (fires), when the VB6-runtime fires-up its own, ANSI-ToolTip-Window
(then overwriting the area of that Window with the original, but now Unicode-rendered Tooltip-Strings).
Even MultiLine-Tooltips are possible this way, when one declares a certain Char as the LineBreak-char
(in our larger VB6-App we've used the PipeChar ("|") for that, IIRC).
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Krool
IMO any hooks should reside in an App and not in this package.
You dont need any hooks when using a new tooltiptext property!
For the basics just add a new public property called "ToolTextTipW" or "ToolTextTipWide" to all controls to store the unicode text displayed by the tooltiptext and use the api CreateWindowExW to create the tooltiptext. no need for any hooks. i can send you my tooltiptext class if you need the source code to do this.
This change would make the VBCCR project more complete. no more need for external classes and tooltip source code cluttered everywhere in the forms/modules.
We also can add additional tooltip properties like icon, title, multiline, forecolor, backcolor, delay time, display time...
Re: CommonControls (Replacement of the MS common controls)
@Mith,
Expose your idea, for someone like me to include it in an embedded fashion use of Krools controls. So then I can place the code to any control I wish to include a Unicode tooltip.
Re: CommonControls (Replacement of the MS common controls)
I have the solution for unicode tooltips. This tested for command button control.
I use from Elroy some routines, and I found a way (using mouse tracking) to enable/disable the tooltip. Also in IDE, in running or at design we get the ordinary vb6 tooltip.
My test program is in the zip file.
We have two more properties:
ToolTipTextEx
ToolTipTextTitle
To prove the solution I place english, greek and russian to same tooltip.
Why I have a second ToolTipText?
Because if we have the original one, then that has something different from the new one, and do some conversions. So we use the second one for the unicode, and that handle the first one for using it in IDE, at design and at running status.
Code:
Private Sub Form_Load()
CommandButtonW1.ToolTipTextTitle = "a TITLE"
CommandButtonW1.ToolTipTextEx = CommandButtonW1.ToolTipTextEx + ListenUnicode(32, 917, 955, 955, 951, 957, 953, 954, 940) + ", " + ListenUnicode(1076, 1086, 1073, 1088, 1086, 1077, 32, 1091, 1090, 1088, 1086)
End Sub
Also in the example below, I have some extra:
1. A way to use a mutex to handle the unique execution of program
2. IsWine is a function to find if the program run in linux through wine
3. To place the greek and russian I use one function, listenUnicode, which get the characters by numbers. To produce these numbers, I have a module testfromclipboard, with one statement: Debug.Print SpellUnicode(GetTextData(CF_UNICODETEXT)), so we copy to clipboard text and we get the numbers in the Immediate window, to copy these as parameters in a ListenUnicode() function.
Revision 2,
I found a missing statement from Elroy's code:
Code:
SendMessage hwndTT, TTM_SETMAXTIPWIDTH, 0&, 0
Without this we didn't get additional lines which the CreateTool introduce these on the wrapping function.
Last edited by georgekar; Nov 18th, 2020 at 05:17 PM.
Reason: New Version
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by OldClock
Or something like this? Looks like a listview per row within a treeview.
A little off topic but one look at this post and WPF immediately came to mind. WPF can do wild and crazy stuff like this very easily. If you're like me and prone to wanting all kinds of crazy combinations of layouts and controls for your UI, you owe it to yourself to check out WPF some time in your life. You will not be disappointed.
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)
I registered the "VBCCR17.OCX" in Windows 10, and then tried to use Krool's controls in VFP 9's IDE, unfortunately, the VFP 9 crash.
It seems that Krool's controls (OCX version) can only work with VB6, but MS common controls can support VFP, delphi or any other programming language correctly.
Re: CommonControls (Replacement of the MS common controls)
Hi!
I browsed through this thread which mentions that its possible to use Transparent images with the the imagelist/toolbar.
I assume that you would need to use PNG files.
I would appreciate on some guidance on how to load PNG files, because the standard methods don't work
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Semke
Hi!
I browsed through this thread which mentions that its possible to use Transparent images with the the imagelist/toolbar.
I assume that you would need to use PNG files.
I would appreciate on some guidance on how to load PNG files, because the standard methods don't work
Isn't it just using a mask color for that, or Icon files?
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by SuperDre
Isn't it just using a mask color for that, or Icon files?
mask colour is a nice way to improvise, and that's what i have been doing until now.
Using PNG files is much cleaner and in my opinion a better way to work (if it is possible).
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Semke
Using PNG files is much cleaner and in my opinion a better way to work (if it is possible).
We all want VB6 to support PNGs but it is a limitation of the product.
You can incorporate La Volpe's code and then you will be able to read and display PNGs in your VB6 image controls. You can also work with GDI+ or similar as it can handle PNGs natively and display them within your VB6 program.
I have used both in my recent creations to handle PNGs. It is a considerable workaround but can be done.
Just expanded VFP 9 to find it means Visual Fox Pro... that is not VB6. The BASIC advice will receive here will not help you much.
Last edited by yereverluvinuncleber; Dec 27th, 2020 at 09:06 AM.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by myfav
I registered the "VBCCR17.OCX" in Windows 10, and then tried to use Krool's controls in VFP 9's IDE, unfortunately, the VFP 9 crash.
It seems that Krool's controls (OCX version) can only work with VB6, but MS common controls can support VFP, delphi or any other programming language correctly.
Ofcourse if the OXC crashes VFP 9's IDE there is a problem with the OCX as it should not do that. Does it crash on the usage of a specific component of the OCX or does it crash completely?
now the size of the RichTextBox content is 3102656 bytes determined by the command:
Code:
Len(rtfLog.Text)
after that i do a word wrap with the command:
Code:
rtfLog.ScrollBars = vbVertical
after the word wrap the content of the RichTextBox is truncated: now the size is only 67731 bytes!
any idea how to word wrap without cutting the content of the RichTextBox?
or is this a bug?
control properties:
Changing the ScrollBars to vbVertical triggers internally a re-creation of the rich text box.
So try to put the code before you load the 6MB file for a quick fix.
However, I would like to test whats the problem. Can you wrap up a demo project?
Changing the ScrollBars to vbVertical triggers internally a re-creation of the rich text box.
So try to put the code before you load the 6MB file for a quick fix.
However, I would like to test whats the problem. Can you wrap up a demo project?
i guess the text content get truncated somewhere at the re-creation function.
Is it really necessary to re-create the whole control when switching the scrollbars?
Isnt there any SendMessage/SetWindowLong command to hide/show the scrollbars?
When you find a way of changing it without re-creation, please advise. However, I could have gone like the MS RichTextBox and throw out an error when attempting to change at runtime.
Re: CommonControls (Replacement of the MS common controls)
Hi Krool ,
A strange behavior in ListView .
When opening some form modally by clicking a ListView column header , it does not have the (Focus) and seems as it is not mainly shown . When you click somewhere on the modal form and this point of click hits the behind column header , the column header click event is fired as if there is no form in front . Also , the form needs two interactions (Clicks) to respond to the mouse click .
I tested this in both OCX and StdExe versions . Here is a Demo to explain what I mean . You need to click any listview header >> Form2 is then shown modally >> then click on the label on Form2 . (I put some positioning code to assure that the click will hit the behind column header) .
Re-test this by opening the form with any other command (Not from Column_Click event .. Say by a command button) , the problem will not arise then .
Edit :
Calling SetCapture API Function solves the issue of passing the click to the behind ListView , but the modal form still needs two clicks to respond and actually receives the focus .
Last edited by Hosam AL Dein; Jan 22nd, 2021 at 12:56 AM.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Hosam AL Dein
Hi Krool ,
A strange behavior in ListView .
When opening some form modally by clicking a ListView column header , it does not have the (Focus) and seems as it is not mainly shown . When you click somewhere on the modal form and this point of click hits the behind column header , the column header click event is fired as if there is no form in front . Also , the form needs two interactions (Clicks) to respond to the mouse click .
I tested this in both OCX and StdExe versions . Here is a Demo to explain what I mean . You need to click any listview header >> Form2 is then shown modally >> then click on the label on Form2 . (I put some positioning code to assure that the click will hit the behind column header) .
Re-test this by opening the form with any other command (Not from Column_Click event .. Say by a command button) , the problem will not arise then .
Edit :
Calling SetCapture API Function solves the issue of passing the click to the behind ListView , but the modal form still needs two clicks to respond and actually receives the focus .
I confirm the issue and clearing the mouse capture before raising the event fixes both issue you encountered. I am just double checking if this is the "correct" solution before I do an update release.
see below new code added in blue
Re: CommonControls (Replacement of the MS common controls)
I've started the conversion of a project using the CC Replacements. Initial results are good, and the unicode support of these controls are very much appreciated!
So far, I ran into two issues that I couldn't figure out:
First
===
In a frame I have 3 shapes, that visually show the status of something, traffic light style. Since shapes don't have events, I'm using the mousedown event of the frame to capture the X-, and Y-coordindates, and check those versus the position of the shapes. This worked fine with the original Frame object, but with the FrameW object, the X and Y that the event returns, don't correspond with the coordinates of the shapes. My guess is that a different scaling is used? Or am I missing something else?
Second
=====
With the classic graphical style command button you could assign an image, and when the button was disabled, the image would be grayed out. There was no need to assign a DisabledPicture. With the CommandButtonW control, the image disappears completely when the button is disabled. Is this by design, and do I have to add a DisabledPicture, or am I missing something?
Re: CommonControls (Replacement of the MS common controls)
Two more questions:
#1. It seems that the Alignment of text in the TextBoxW doesn't work. Neither setting in the IDE, nor setting it at runtime in code gives another result than left align.
#2. I have a statusbar with 5 panels. Panels 1, 4, and 5 are fixed. The remaining space is divided between panels 2 and 3. For the standard CC statusbar, I updated the width of panels 2 and 3 in the form resize event. When I do that now with the CCR statusbar, the width of the panels is not calculated correctly.
My original code:
Code:
With brStatusBar
.Panels(2).Width = (frmMain.ScaleWidth - .Panels(1).Width - .Panels(4).Width - .Panels(5).Width) / 2
.Panels(3).Width = (frmMain.ScaleWidth - .Panels(1).Width - .Panels(4).Width - .Panels(5).Width) / 2
End With
I also tried with:
Code:
With brStatusBar
.Panels(2).Width = (.Width - .Panels(1).Width - .Panels(4).Width - .Panels(5).Width) / 2
.Panels(3).Width = (.Width - .Panels(1).Width - .Panels(4).Width - .Panels(5).Width) / 2
End With
Last, but not least, I also tried moving this to the form Paint event. Unfortunately to no avail.
Re: CommonControls (Replacement of the MS common controls)
Originally Posted by Erwin69
First
===
In a frame I have 3 shapes, that visually show the status of something, traffic light style. Since shapes don't have events, I'm using the mousedown event of the frame to capture the X-, and Y-coordindates, and check those versus the position of the shapes. This worked fine with the original Frame object, but with the FrameW object, the X and Y that the event returns, don't correspond with the coordinates of the shapes. My guess is that a different scaling is used? Or am I missing something else?
I tested a shape in a FrameW control and the X and Y coordinates correspond correctly. It's origin is of course the FrameW. Like for the VB.Frame.
Please provide demo showing otherwise.
Originally Posted by Erwin69
Second
=====
With the classic graphical style command button you could assign an image, and when the button was disabled, the image would be grayed out. There was no need to assign a DisabledPicture. With the CommandButtonW control, the image disappears completely when the button is disabled. Is this by design, and do I have to add a DisabledPicture, or am I missing something?
What do you mean? It is always better to have a DisabledPicture, instead of relying on the to gray out the Picture object by the control.
Below is a picture object where the left side has Enabled property set to True and right side set to False in a CommandButtonW. (no DisabledPicture object used here)
What's wrong with it? Please advise.
Originally Posted by Erwin69
#1. It seems that the Alignment of text in the TextBoxW doesn't work. Neither setting in the IDE, nor setting it at runtime in code gives another result than left align.
I cannot replicate it. Please provide demo.
If you are using the OCX version, which version do you use?
Originally Posted by Erwin69
#2. I have a statusbar with 5 panels. Panels 1, 4, and 5 are fixed. The remaining space is divided between panels 2 and 3. For the standard CC statusbar, I updated the width of panels 2 and 3 in the form resize event. When I do that now with the CCR statusbar, the width of the panels is not calculated correctly.
This is complicated. I need a demo from you which has the MS statusbar and the VBCCR statusbar beneath (or each in a own Form) and showing the differences.
Thanks
Re: CommonControls (Replacement of the MS common controls)
Hi Krool, thanks for the feedback. Find attached a small demo that shows the issues.
#1. Clicking the colored circles should move the "selector box" to the one clicked. The messagebox shows the X and Y that are returned, which are of a totally different scale than the coordinates of the Shapes.
#2. The 5 graphical buttons have no disabled picture assigned. Clicking the <Enabled> button on the right of the frame, displays all pictures. Clicking the <Disabled> button, causes them to disappear completely.
#3. The three colored textboxes have been assigned the various align options. The text still aligns to the left in all three.
#4. Both MS and VBCCR statusbars have been set up with 5 panels with widths of respectively 2000, 1275, 1440, 2000, and 2000. On initial load, the panels in both statusbars are aligned, but as soon as the form is resized, the VBCCR panels 2 and 3 are given widths that are too large.
Re: CommonControls (Replacement of the MS common controls)
Update released.
Critical bugfix in the FrameW control.
Mouse events were scaled to pixels instead of twips.
Originally Posted by Erwin69
#1. Clicking the colored circles should move the "selector box" to the one clicked. The messagebox shows the X and Y that are returned, which are of a totally different scale than the coordinates of the Shapes.
The ScaleMode of the UserControl was set to pixels instead of twips.
This has no affects on the ContainedControls property since the container reports always in twips.
However, this mis-setting led to wrong scaled values in the mouse events. (e.g. MouseDown)
The problem should now be resolved for the VBCCR17.OCX (1.7.3)
Originally Posted by Erwin69
#2. The 5 graphical buttons have no disabled picture assigned. Clicking the <Enabled> button on the right of the frame, displays all pictures. Clicking the <Disabled> button, causes them to disappear completely.
I use the DrawState API with DSS_DISABLED when no DisabledPicture is available and the control has Enabled = False.
However, it seems the API works better with DST_ICON and works not so good with DST_BITMAP.
Just a note. DSS_DISABLED will treat a white color as transparent. So you can try changing the MaskColor to white. (your picture needs to be changed of course)
Or best. You supply a proper DisabledPicture object..
Originally Posted by Erwin69
#3. The three colored textboxes have been assigned the various align options. The text still aligns to the left in all three.
The VB.TextBox will re-create the control when the Alignment property changes.
However, the VBCCR TextBoxW uses SetWindowLong to change the Alignment.
Reason is that setting ES_CENTER or ES_RIGHT upon CreateWindowEx causes problems for a multi-line edit control which has horizontal scrollbars.
That's why it is set after CreateWindowEx via SetWindowLong.
BUT, I just noticed that prior to Windows Vista (e.g. Windows XP) the ES_CENTER and ES_RIGHT bits are NOT modified-able.
Even the comctl32.dll version 5.8x on Windows 7 (or Windows 10) does allow it.
So, I am in a dilemma right now on this where I don't know how to react to...