Error with TextBoxW.OverTypeMode property
Attachment 178818
Printable View
Error with TextBoxW.OverTypeMode property
Attachment 178818
I cannot replicate your problem. I just tested AllowOverType property (which toggles OverTypeMode property upon Insert key) and it worked.
Please bundle a demo showing the issue. Thanks
Style 1 - Graphical implies the BS_OWNERDRAW window style. It's just another possibility to have picture and caption without depending on BS_OWNERDRAW.
I don't know what you mean exactly. When I set the ComboBoxW1 style to 0 - DropDownCombo in the ComCtlsDemo project and I type 'charlie' it automatically becomes 'Charlie' without using the dropdown. So for me it is working. (the ListIndex is updated)
Again please provide demo so I can look what the problem is.
I have tested the AutoSelect property under:
1. WinXP SP3 with comctl32.dll versions 5.82.2900.6028 and 6.0.2600.0
2. Win10 x64
It was ComCtlsDemo project from v1.7.0.0
I tried two experiments. The first one:
1. I made the ComboBoxW1 dropped down (style 0)
2. I typed "char" in the text field of ComboBoxW1
3. I pressed the Tab key on my keyboard
4. The text field was filled automatically and the ListIndex was updated
The second experiment:
1. I made the ComboBoxW1 closed up (style 0)
2. I typed "charlie" in the text field of ComboBoxW1
3. I pressed the Tab key on my keyboard
4. The text field was NOT changed automatically and the ListIndex = -1
Attachment 178821
Here it is. Tested under WinXP SP3 with comctl32.dll version 5.82.2900.6028
CCRP v1.7.0.0
Attachment 178822
The ComboBoxW1 in the ComCtlsDemo project has AutoSelect property as False. Please ensure to set it to True.
I could replicate it on Windows XP, but not on Windows 10.
The root cause is that there is an access violation when the edit control receives EM_REPLACESEL with a null pointer.
The RichEdit control does not crash with a null pointer and EM_REPLACESEL.
My guess is that after Windows XP there was a fix so that a null pointer in EM_REPLACESEL does not crash anymore the edit control.
I have noted this down and will probably soon make a fix that kinda looks like following for the SelText property:
Code:If StrPtr(Value) = 0 Then Value = ""
Oh, yes. You are right. I forgot it. :D But the problem is exist. When you type "charlie", it becomes "Charlie". But when you type "char", the behavior depends on the DroppedDown state. As I understand, this is not the problem of AutoSelect property. It would be nice if "Char" always became "Charlie".
Krool, how does the FontCombo.BuddyControl property work? What kind of control should I use with this property?
What about the VBFlexGrid.HitTest? This is a Sub, not a Function. But it should "return a value which indicates the element located at the specified X and Y coordinates."
The same question about the ComputeControlSize method of the ListView and MonthView controls.
I don't know is this intended or not behaviour, but...
Monthview does not refresh correctly, when multiple months are shown and selection extends to month(s) over leftmost month, which are not shown after mouseleave event.
Select range extending to second and or third month displayed.
After MouseLeave and MouseEnter events, monthview draws only leftmost month date range selection.
Krool, Im adding column headers and then items to the listview in report mode on form load. Im getting a Itemclick then an ItemSelect event as the first listItem is added before any following columns are even filled out or the listview is visible or the form is fully loaded. This makes my click and select code fail because of incomplete information. Is this a bug or intended behavior? I can set a flag to delay processing till initial load is done if needed but was curious...
Hi Krool
My question is about DTPicker
I want to know if possible to automatically move to next datepart.
I mean selection focus moves to months (mm) after having entered the the days (dd).
And move to the year(yyyy) part once the month is entered or vice versa.
thank you
The ItemSelect event is intended. The V6 MS.ListView behaves the same.
However, the V5 MS.ListView behaves different.
You can make the AutoSelectFirstItem property set to False (mimic V5 MS ListView behavior), then there will be no ItemSelect event fired when adding the first item. (but it is also not selected, only focused)
The ItemClick event is not fired on my side. Can you share a demo showing this ? The ListView control only raises ItemClick upon NM_CLICK, NM_RCLICK. So this should not happen during the feed of a ListView. I cannot replicate that issue for you..
There is no straight forward dedicated message for that. However, you can trick the DTPicker in doing so.
move focus to the right
move focus to the leftCode:SendMessage DTPicker1.hWnd, WM_KEYDOWN, vbKeyRight, ByVal 0&
Code:SendMessage DTPicker1.hWnd, WM_KEYDOWN, vbKeyLeft, ByVal 0&
I tested the trick but with no successQuote:
you can trick the DTPicker in doing so
I used the code in change event and in key down event but it did not work as expected.
Anyway thank you very much
Dark Mode question
I have found a program which uses the windows common controls, and it can render them in other colors.
As an example I see this with Spy++:
Attachment 179149
So it _seems_ to be possible.
Or am I wrong?
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.
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).
Olaf
IMO any hooks should reside in an App and not in this package.
So you can use the CommandButtonW.ToolTipText property and use this Code to enable Unicode and multi-line. (See bottom post by MountainMan)
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...
I am waiting for the new version with ToolTextTipW
@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.
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.
Also in the example below, I have some extra: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
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:
Without this we didn't get additional lines which the CreateTool introduce these on the wrapping function.Code:SendMessage hwndTT, TTM_SETMAXTIPWIDTH, 0&, 0
Hey, is it possible to have columns in the treeview?
Sample image from the net attached.
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.
The vsFlexGrid is capable of showing a tree in a column of the grid.
Maybe Krool will implement something like this in his vbFlexGrid control
Thank you, but as far as I can tell, WPF is not VB6.
Is it possible to have word-wrap/newlines in a row in a VBCCR16/17 listview?
@OldClock
You can accomplish your desired outputs quite easily, when you use Virtual-List-Controls.
Here's two different ones, I've posted into the CodeBank (both without RichClient-dependencies, though still quite small CodeBases):
https://www.vbforums.com/showthread....TreeList-Demo)
https://www.vbforums.com/showthread....)-TileView-Ctl
HTH
Olaf
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.
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
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.
vbccr v1.7.1
i can't enter the maximum supported character length of 32K chars using the textboxW control.
i tried it with the following code:
textboxW.text = String(32000, "a")
or
textboxW.text = String(6500, "a")
none of them above filled the textbox!
but String(650, "a") works!
the maxlength property is set to 0.
Edit:
after some testing i found out that the limit is 4095 chars...
Edit2:
Problem solved:
the property .MultiLine=True enables the support of 32K maximum characters!
vbccr v1.7.1
i load a 6 MB text file into a RichTextBox using the command:
now the size of the RichTextBox content is 3102656 bytes determined by the command:Code:rtfLog.LoadFile sLogFile, RtfLoadSaveFormatUnicodeText
after that i do a word wrap with the command:Code:Len(rtfLog.Text)
after the word wrap the content of the RichTextBox is truncated: now the size is only 67731 bytes! :(Code:rtfLog.ScrollBars = vbVertical
any idea how to word wrap without cutting the content of the RichTextBox?
or is this a bug?
control properties:
Attachment 179876
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?
Example:
Style = GetWindowLong(rtbHandle, GWL_STYLE)
Style = Style And WS_VSCROLL
SetWindowLong (rtbHandle,GWL_STYLE,Style)
it's not possible. i tried but after i read this at the MS doc: "After the control has been created, these styles cannot be modified, except as noted.": https://docs.microsoft.com/en-us/win...control-styles
looks like re-creation is the only way to to this...
btw, i found out that using TextMode=1 solves my problem:
the text content doesnt got manipulated after switching the scrollbars!
using TextMode=0 and switching the scrollbars to enable WordWrap truncates the text!
Maybe you will check this out.
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 .
Attachment 179975
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
Code:Case LVN_COLUMNCLICK
CopyMemory NMLV, ByVal lParam, LenB(NMLV)
ReleaseCapture
RaiseEvent ColumnClick(Me.ColumnHeaders(NMLV.iSubItem + 1))
Yes , It is clear for now . Thanks Krool
Attached Files Attached Files
File Type: zip ComCtlsDemo.zip (825.6 KB, 84 views)
when i opened ComCtlsDemo on vb6.0 this error ocurred
Someone knows the reason
Error screenshot : Attachment 180135
Do you have the option "Break on all errrors" checked?, if the answer is yes, check the option "Break on unhandlled errors"
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?
All advice is appreciated! Thanks in advance!
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:
I also tried with: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
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.
Any suggestions?
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.
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.
Attachment 180202
I cannot replicate it. Please provide demo.
If you are using the OCX version, which version do you use?
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
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.
I'm using version 1.7.0.1 of the OCX.
Attachment 180203
Update released.
Critical bugfix in the FrameW control.
Mouse events were scaled to pixels instead of twips.
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)
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..
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...