-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
godeny
As the VirtualCombo is a new control, it is not a compatibility case, but when setting the ListIndex property of the control, why is the text field not updated ?
Fixed. Thanks
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
godeny
Two incompatibilities I've noticed so far:
- The HitTest method of the Treeview control needs the coordinates in Pixels. The original MS control needed them in Twips. (The form the control is placed on has ScaleMode=3, it uses Pixels). Pixels seem to me a better choice in this case, but is an incompatibility.
- When the KeyPreview property of the containing form is set to true, I don't get it though some keystrokes from the TextboxW and ComboBoxW control int the forms KeyDown event - for example, the up and down arrows. I have to use the KeyDown event of that controls - of each of them - to grab this keystrokes, and to redefine, what they are doing.
Bad for the HitTest... fixing it now would cause an incompatibility in the VBCCR history. So I think need to keep it like that.
KeyPreview can't be fixed..
-
Re: CommonControls (Replacement of the MS common controls)
Hittest: it is a very simple change, one can live good with it.
KeyPreview: I was surprised by the answer, as the original Microsoft controls did it correctly.
Does VBCCR use another window class, as the original VB controls ?
-
1 Attachment(s)
ListView & TextBoxW SetFocus Bug
VBCCR OCX 1.7.88
VB6SP6 Win10
Problem: The ListView "steals" the focus from a TextBoxW
1. I use the ListViewW in report mode.
2. I click on a item.
3. At the MouseUp event i set the focus to a TextBoxW but the ListView catches the focus again after the MouseUp event is done.
I tried the same with the MS controls and the focus stays at the TextBox:
1. MS ListView in report mode.
2. I click on a item.
3. At the MouseUp event i set the focus to a MS Textbox and the focus stays in the TextBox.
Another problem occured with the Validate event of the TextBoxW:
If the focus is on the TextBox and i click on another control or the form, the TextBox focus is gone but the Validate event of the TextBox isnt triggered to hide the TextBox!
See attached VB example project.
Can this 2 issues be fixed?
-
Re: ListView & TextBoxW SetFocus Bug
Quote:
Originally Posted by
Mith
VBCCR OCX 1.7.88
VB6SP6 Win10
Problem: The ListView "steals" the focus from a TextBoxW
1. I use the ListViewW in report mode.
2. I click on a item.
3. At the MouseUp event i set the focus to a TextBoxW but the ListView catches the focus again after the MouseUp event is done.
I tried the same with the MS controls and the focus stays at the TextBox:
1. MS ListView in report mode.
2. I click on a item.
3. At the MouseUp event i set the focus to a MS Textbox and the focus stays in the TextBox.
Another problem occured with the Validate event of the TextBoxW:
If the focus is on the TextBox and i click on another control or the form, the TextBox focus is gone but the Validate event of the TextBox isnt triggered to hide the TextBox!
See attached VB example project.
Can this 2 issues be fixed?
Thanks for reporting.
The list view control enters a modal message loop (DragDetect) on WM_LBUTTONDOWN and WM_RBUTTONDOWN.
The problem here seems that 'MouseUp' is fired within NM_CLICK and NM_RCLICK.
And the list view control seems to set the focus in it's handler afterwards.
The solution may be to use PostMessage to delay firing 'MouseUp' after NM_CLICK, NM_RCLICK.
-
Re: ListView & TextBoxW SetFocus Bug
I found a temporary solution to fix this:
The ItemDblClick event doesnt behave like the MouseUp event. The focus stays in the textbox after the ItemDblClick event is done.
-
Re: CommonControls (Replacement of the MS common controls)
The "problem" after NM_CLICK and NM_RCLICK was my code...
Code:
Case WM_LBUTTONDOWN
' In case DragDetect returns 0 then the control will set focus the focus automatically.
' Otherwise not. So check and change focus, if needed.
If GetFocus() = UserControl.hWnd Then SetFocusAPI hWnd
If GetFocus() <> hWnd Then SetFocusAPI hWnd
the red part is the old code and the new code is blue which fixes the issue.. will check to be sure but then release it soon.
And when the focus is not stolen the problem with the validate event is also fixed of course.
-
Re: ListView & TextBoxW SetFocus Bug
Quote:
Originally Posted by
Mith
VBCCR OCX 1.7.88
VB6SP6 Win10
Problem: The ListView "steals" the focus from a TextBoxW
1. I use the ListViewW in report mode.
2. I click on a item.
3. At the MouseUp event i set the focus to a TextBoxW but the ListView catches the focus again after the MouseUp event is done.
I tried the same with the MS controls and the focus stays at the TextBox:
1. MS ListView in report mode.
2. I click on a item.
3. At the MouseUp event i set the focus to a MS Textbox and the focus stays in the TextBox.
Another problem occured with the Validate event of the TextBoxW:
If the focus is on the TextBox and i click on another control or the form, the TextBox focus is gone but the Validate event of the TextBox isnt triggered to hide the TextBox!
See attached VB example project.
Can this 2 issues be fixed?
Update released. Fixed.
-
Re: ListView & TextBoxW SetFocus Bug
Quote:
Originally Posted by
Krool
Update released. Fixed.
I can confirm that the SetFocus bug is fixed now!
But the TextBox Validate event is still not triggered when i click on another control or the form.
I've tested this with my VB example project from my post #3644
-
Re: ListView & TextBoxW SetFocus Bug
Quote:
Originally Posted by
Mith
I can confirm that the SetFocus bug is fixed now!
But the TextBox Validate event is still not triggered when i click on another control or the form.
I've tested this with my VB example project from my post
#3644
I can't replicate. For me in the demo both are behaving the same. You use the ListView_Validate event, right ?
Since the TextBox has the focus it will not trigger any validating when clicking on another control since the ListView does not have the focus.
-
Re: ListView & TextBoxW SetFocus Bug
Quote:
Originally Posted by
Krool
I can't replicate. For me in the demo both are behaving the same. You use the ListView_Validate event, right ?
Since the TextBox has the focus it will not trigger any validating when clicking on another control since the ListView does not have the focus.
Your are right! My fault, i used the wrong control event :blush:
-
5 Attachment(s)
CommandButtonW with SplitButton not scaled at 150%
VBCCR OCX 1.7.89
I use the CommandButtonW with SplitButton=True. Using a UI scale of 150% or higher the DropDown arrow is much bigger and the button width is not adjusted. Tested with Win7. Is this something that can be fixed?
See screenshots:
100%
Attachment 189839
125%
Attachment 189840
150%
Attachment 189841
175%
Attachment 189842
200%
Attachment 189843
-
Re: CommonControls (Replacement of the MS common controls)
VBCCR OCX 1.7.82 - 1.7.89
VB6SP6 Win10
After the 10-Dec-2023 update there is no dropdown area of ImageCombo. But only a thin line under the combo when I click the dropdown button.
Strangely, this does not happens on all forms. Somewhere it's works normaly.
Attachment 189844
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
tnrprog
After the 10-Dec-2023 update there is no dropdown area of ImageCombo. But only a thin line under the combo when I click the dropdown button.
No probem here using VBCCR OCX 1.7.89 with VB6SP6 Win10:
Attachment 189845
Maybe you should check the MaxDropDownItems property and the ListCount property of the ImageCombo at runtime.
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool
I noticed that with Vb updown Dtpicker, I can change up or down the date without getting focus on the control.
However with your updown Dtpicker, I must first click inside the Dtpicker so that I can change the date value.
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
Improvement in the BuddyControl property in the UpDown control.
The property value "_Value" was an alias for the DISPID_VALUE property. (default property)
However, MS UpDown control used an alias "_Default". Thus the UpDown control promotes and shows in the drop-down list "_Default".
But for compatibility reasons a value of "_Value" is accepted. During UserControl_ReadProperties "_Value" will be replaced by "_Default".
But again, setting "_Value" later on by code will still work as an alias. But will then be replaced to "_Default".
-
Re: CommonControls (Replacement of the MS common controls)
Krool
Would you update the UpDown DTPicker when the customFormat is set to "yyyy"?
I can change the MS UpDown date value by just clicking the arrows up or down.
But for your control, I need to set focus on the control (by clicking inside the control) before I can change the date by means of arrows.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
newbie2
Krool
Would you update the UpDown DTPicker when the customFormat is set to "yyyy"?
I can change the MS UpDown date value by just clicking the arrows up or down.
But for your control, I need to set focus on the control (by clicking inside the control) before I can change the date by means of arrows.
The UpDown window doesn't take over the focus. That's normal for msctls_updown32.
Solution will be following code addition. Which seems to be exactly what the MS DTPicker control is doing. (for example keep pressing up or down button and try to tab key away, focus will be set back instantly in MS DTPicker control)
Code:
Case UDN_DELTAPOS
If GetFocus() <> hWnd Then UCNoSetFocusFwd = True: SetFocusAPI UserControl.hWnd: UCNoSetFocusFwd = False
WindowProcControl = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)
' Fallback just in case the control would not set the focus automatically.
If GetFocus() = UserControl.hWnd Then SetFocusAPI hWnd
Exit Function
The SysDateTimePick32 handles of course UDN_DELTAPOS but will set the focus then to itself. Here it is just important to let VB know that the UserControl has focus so that the SysDateTimePick32 will not be disturbed when it will set the focus to itself. This also ensures that the correct "field" will have the focus and that the up down arrow will work without clicking first on the control.
Update will follow soon ..
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
newbie2
Krool
Would you update the UpDown DTPicker when the customFormat is set to "yyyy"?
I can change the MS UpDown date value by just clicking the arrows up or down.
But for your control, I need to set focus on the control (by clicking inside the control) before I can change the date by means of arrows.
Done. Thanks for bringing this up.
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
No probem here using VBCCR OCX 1.7.89 with VB6SP6 Win10:
Maybe you should check the MaxDropDownItems property and the ListCount property of the ImageCombo at runtime.
1) When I using an earlier version of the OCX, the bug does not appear in my project.
2) At runtime MaxDropDownItems correctly returns 9
But this code removes the bug.
Code:
Img Combo.MaxDropDownItems = 1
Img Combo.MaxDropDownItems = 9
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Can you add the transparency attribute to all your controls?
In addition, if we can develop a second set of controls, similar to the flat buttons of Android or iOS systems. The UI component
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
tnrprog
1) When I using an earlier version of the OCX, the bug does not appear in my project.
2) At runtime MaxDropDownItems correctly returns 9
But this code removes the bug.
Code:
Img Combo.MaxDropDownItems = 1
Img Combo.MaxDropDownItems = 9
I found the bug. You have probably missing _ExtentX/_ExtentY meta data in your .frm for the ImageCombo.
Update will follow soon.
ComboBoxW/FontCombo/VirtualCombo are not affected.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
xiaoyao
Can you add the transparency attribute to all your controls?
In addition, if we can develop a second set of controls, similar to the flat buttons of Android or iOS systems. The UI component
What controls are missing ? The FrameW control for example has already a transparent property.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
tnrprog
VBCCR OCX 1.7.82 - 1.7.89
VB6SP6 Win10
After the 10-Dec-2023 update there is no dropdown area of ImageCombo. But only a thin line under the combo when I click the dropdown button.
Strangely, this does not happens on all forms. Somewhere it's works normaly.
Attachment 189844
Done. Fixed.
-
Richtextbox Clear command sound problem
VBCCR OCX1.7.89
VB6SP6 Win10
I have a sound problem with the CLEAR command of the RichTextBox:
Windows always plays a annoying sound jingle when i use the CLEAR command to delete the content.
Is there any difference using .Text="" or .Clear to delete the content of the RichTextBox?
Can i disable this sound somehow or should i only use .Text="" and avoid .Clear?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Done. Fixed.
Thank you. But I think that not everything is OK yet.
Now the dropdown shows only one item. Although MaxItemCount returns 9. And in the old version everything is OK.
Attachment 189938
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
tnrprog
Thank you. But I think that not everything is OK yet.
Now the dropdown shows only one item. Although MaxItemCount returns 9. And in the old version everything is OK.
Attachment 189938
How many combo items are added?
MaxDropDownItems of 9 means when there are no items, it won't show 9.
-
Re: Richtextbox Clear command sound problem
Quote:
Originally Posted by
Mith
VBCCR OCX1.7.89
VB6SP6 Win10
I have a sound problem with the CLEAR command of the RichTextBox:
Windows always plays a annoying sound jingle when i use the CLEAR command to delete the content.
Is there any difference using .Text="" or .Clear to delete the content of the RichTextBox?
Can i disable this sound somehow or should i only use .Text="" and avoid .Clear?
I can't replicate. Normally such a beep occurs within KeyPress and enter when KeyAscii was not set to 0.
Can you provide a small demo ? Thx
-
Re: Richtextbox Clear command sound problem
Quote:
Originally Posted by
Krool
I can't replicate. Normally such a beep occurs within KeyPress and enter when KeyAscii was not set to 0.
Can you provide a small demo ? Thx
I found the reason:
the sound is played if the Locked property is set to TRUE.
-
Re: Richtextbox Clear command sound problem
Quote:
Originally Posted by
Mith
I found the reason:
the sound is played if the Locked property is set to TRUE.
ok, that seems to be then a reacton of WM_CLEAR itself.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
How many combo items are added?
The Combo from the screenshot has 4 items (ComboItems.Count returns 4). But it shows 1, no matter how many of them are real.
https://www.vbforums.com/attachment....hmentid=189938
Quote:
Originally Posted by
Krool
MaxDropDownItems of 9 means when there are no items, it won't show 9.
I understand how MaxDropDownItems works.
I just reported that MaxDropDownItems=9. Because On the screenshot it looks like MaxDropDownItems=1
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
tnrprog
The Combo from the screenshot has 4 items (ComboItems.Count returns 4). But it shows 1, no matter how many of them are real.
I understand how MaxDropDownItems works.
I just reported that MaxDropDownItems=9. Because On the screenshot it looks like MaxDropDownItems=1
the screenshot is not working. Can you provide a demo project ?
-
Re: CommonControls (Replacement of the MS common controls)
Hello! The definition "CCMousePointerConstants" has been lost in recent versions : Standard EXE Version\Builds\Slider; Standard EXE Version\Builds\UpDown.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Plohish
Hello! The definition "CCMousePointerConstants" has been lost in recent versions : Standard EXE Version\Builds\Slider; Standard EXE Version\Builds\UpDown.
Please replace the other components as well. I am gradually replacing the MousePointer properties to enums.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Can you provide a demo project ?
I found that the bug occurs due to a change the 'DropDownWidth' property in the 'DropDown' event. So I can get around it.
However, in earlier versions there was no problem at all.
Attachment 189947
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
What controls are missing ? The FrameW control for example has already a transparent property.
Text boxes, buttons, picture controls. There are many, if each control can set the background image or transparent, that would be the best.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
tnrprog
I found that the bug occurs due to a change the 'DropDownWidth' property in the 'DropDown' event. So I can get around it.
However, in earlier versions there was no problem at all.
Attachment 189947
Ok, a part of the 10-Dec-2023 change for ImageCombo got now reversed as it seems the ImageCombo is caching something and it does need a resize on the control itself rather then SetWindowPos on the list handly only. (for CheckDropDownHeight)
So, fixed.
ComboBoxW/FontCombo/VirtualCombo are not affected and use still the initial change of 10-Dec-2023.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
godeny
KeyPreview: I was surprised by the answer, as the original Microsoft controls did it correctly.
Does VBCCR use another window class, as the original VB controls ?
I don't know how..
The trick once wrote, quote:
Quote:
The form won't get that message because that message is processed by the control. A control processes the IOleInPlaceActiveObject::TranslateAccelerator and then can pass the call to container by calling IOleControlSite::TranslateAccelerator. The runtime checks if the form has the KeyPreview = True and calls the event.
However, calling IOleControlSite always return S_OK and does not case the frame top-level container IOleInPlaceFrame to raise the KeyDown event.
I can get the IOleInPlaceFrame object from within IOleInPlaceActiveObject::TranslateAccelerator and the hWndFrame (which is VB.Form or VB.UserControl)
However, how to know the KeyPreview state or invoke something ? I need some help here. I can cast IOleInPlaceFrame to IDispatch and get the KeyPreview property of a VB.Form, but that looks odd and hacky.
-
Re: CommandButtonW with SplitButton not scaled at 150%
Quote:
Originally Posted by
Mith
I just wanted to let you know that the scaling problem doesn't occur with Windows 10/11.
I guess this is a specific problem of the Win7 UI scaler that cant be fixed by code.