-
Re: CommonControls (Replacement of the MS common controls)
How to compile OCX version? Is there a special instruction?
I'm receiving the error while compilation: "Object doesn't support this property or method" pointing to:
Code:
Public Function GetDispID(ByVal This As Object, ByRef MethodName As String) As Long
Dim IDispatch As OLEGuids.IDispatch, IID_NULL As OLEGuids.OLECLSID
Set IDispatch = This
IDispatch.GetIDsOfNames IID_NULL, StrPtr(MethodName), 1, 0, GetDispID
End Function
at "Writing OCX" stage.
Hmm, well, same issue with Std-exe.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Dragokas
How to compile OCX version? Is there a special instruction?
I'm receiving the error while compilation: "Object doesn't support this property or method" pointing to:
Code:
Public Function GetDispID(ByVal This As Object, ByRef MethodName As String) As Long
Dim IDispatch As OLEGuids.IDispatch, IID_NULL As OLEGuids.OLECLSID
Set IDispatch = This
IDispatch.GetIDsOfNames IID_NULL, StrPtr(MethodName), 1, 0, GetDispID
End Function
at "Writing OCX" stage.
Hmm, well, same issue with Std-exe.
Just update your OLEGuids.tlb
-
Re: CommonControls (Replacement of the MS common controls)
Krool, thanks!
I forgot to re-register as HKCU. Works good.
Have a nice day!
-
Re: CommonControls (Replacement of the MS common controls)
Hi,
Two questions:
UNICODE TOOLTIPS
In an old post in this thread it was stated that tooltips don’t support Unicode texts. Is that still the case, or is there a simple trick to assign the Unicode text to a CommandButton tooltip?
FASTEST WAY TO MOVE A SET OF DATA INTO A LISTVIEW
When working with sets of data, there is for example the Recordset.GetRows feature to quickly move all data retrieved from a database into an array. For exporting to Excel there is the Range.Resize function to quickly move the data from an array into a worksheet.
Does the ListView control offer such features as well, or is it simply a matter of cycling through the records in the recordset, or the items in the array, and using ListItem.Add and SubItems to add the data to the control?
Thanks,
Erwin
-
Re: CommonControls (Replacement of the MS common controls)
Hi,
Another question:
COLORING ITEMS IN A COMBO
Is it possible to give individual items in a combobox / dropdown list different colors, or use a different font?
Thanks,
Erwin
-
Re: CommonControls (Replacement of the MS common controls)
so far I have not used it, much because the demo is huge.
today I decided to try one component. it was not easy, took me 10 minutes to create a new project and copy the needed files. (it was not obvious, lots of search and find the dependency needed and copy)
total of 8 mod/class/usercontrol and the tlb + some work with the registry to remove an old-entry that made it all stuck.
after all that I find myself with too many files, its confusing and Im not sure its worth it.
my solutions so far have been to create graphical-interface with, 10% or less coding and easier to manage.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
baka
so far I have not used it, much because the demo is huge.
today I decided to try one component. it was not easy, took me 10 minutes to create a new project and copy the needed files. (it was not obvious, lots of search and find the dependency needed and copy)
total of 8 mod/class/usercontrol and the tlb + some work with the registry to remove an old-entry that made it all stuck.
after all that I find myself with too many files, its confusing and Im not sure its worth it.
my solutions so far have been to create graphical-interface with, 10% or less coding and easier to manage.
Why don't you use the OCX? 1 file, simple and straightforward.
The primary reasone why I switched to Krool's controls, was to have Unicode support for my apps' user interfaces. Before them, supporting Unicode languages like Russian, Thai and Korean was a serious pain in the @ss, and only worked when the underlying Windows version was running in that language. Now it is no problem to run my apps in Korean on a French Windows, in Russian on an Italian Windows, etc.
All other enhancements are a bonus, and I believe there are plenty!
It works as a charm, and if I have any questions, I post them here and most of the time they are answered very quickly.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Erwin69
Hi,
Another question:
COLORING ITEMS IN A COMBO
Is it possible to give individual items in a combobox / dropdown list different colors, or use a different font?
Thanks,
Erwin
Use the DrawMode property and handle ItemMeasure/ItemDraw event.
For different fonts use DrawMode = Variable.
You can look in the FontCombo control. It's an built-in owner draw combo box.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Use the DrawMode property and handle ItemMeasure/ItemDraw event.
For different fonts use DrawMode = Variable.
You can look in the FontCombo control. It's an built-in owner draw combo box.
Thanks for the answer Krool, but I'm afraid this is a bit, or better said, waaaaaay beyond my skillset...
I studied your code for the FontCombo control, Googled examples of owner draw handling, and walked away cross-eyed. :eek:
What I was hoping for was something as simple as
Code:
MyListView.ListItems(i).ForeColor = vbRed
but then for the combo/dropdown.
Sometimes I think I'm doing pretty cool things, but then I come across stuff like this, and realize I'm just a mere mortal... :bigyello:
I'll figure out another approach.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Can you add transparency properties to every newly invented, modern control?
For example, two options: use the picture property of the parent control, or specify a screenshot of all subsequent controls as the background image (hide the control itself, take a picture of the area of the form, and then display the custom control)
Attachment 189110
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
CoolBar/ToolBar/TabStrip/StatusBar control now redirects to WM_PRINT (PRF_CLIENT Or PRF_ERASEBKGND) upon WM_PAINT when wParam is <> 0.
All Transparent properties improved to use GetParent() instead of .ContainerHwnd.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Hello Krool!
The 'Animation' control, after referencing 'VBCCR17.OCX' and compiling it into an exe file, reported an error when running the exe file, with the error prompt '326 Resource with identifier' 100 'not found'”
The error code is:
Animation1.LoadRes 100
Attachment 189190
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
smileyoufu
Hello Krool!
The 'Animation' control, after referencing 'VBCCR17.OCX' and compiling it into an exe file, reported an error when running the exe file, with the error prompt '326 Resource with identifier' 100 'not found'”
The error code is:
Animation1.LoadRes 100
Attachment 189190
This
Code:
Animation1.LoadRes 100
is from the demo project. (MainForm.frm)
You can delete it in your app..
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
This
Code:
Animation1.LoadRes 100
is from the demo project. (MainForm.frm)
You can delete it in your app..
I found this issue when testing VBCCR17.OCX using the "ComCtlsDemo" demonstration file. If I don't remove the line "Animation1. LoadRes 100", it will cause the exe file to completely fail to start and report the error in # 3612 above. The exe file cannot start until the line is deleted.
Animation Can't the LoadRes method load the contents of the res file in exe?
If this is not a problem, please ignore it.
Thank you very much!
Attachment 189192
-
Re: CommonControls (Replacement of the MS common controls)
Possible bug with ListBox style "Checkbox". Can't set checkbox to be checked. Is VBCCR have different property?
Repro:
Add VB ListBox (Style:Checkbox) & VBCCR ListBox (Style:ListStyleCheckbox)
Run code:
Code:
Private Sub Form_Load()
Dim i&
With List1
.AddItem "item1"
.AddItem "item2"
For i = 0 To .ListCount - 1
.Selected(i) = True
Next
End With
With ListBoxW1
.AddItem "item1"
.AddItem "item2"
For i = 0 To .ListCount - 1
.Selected(i) = True
Next
End With
End Sub
Result: https://www.vbforums.com/images/ieimages/2023/11/2.png
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Dragokas
Possible bug with ListBox style "Checkbox". Can't set checkbox to be checked. Is VBCCR have different property?
Repro:
Add VB ListBox (Style:Checkbox) & VBCCR ListBox (Style:ListStyleCheckbox)
Run code:
Code:
Private Sub Form_Load()
Dim i&
With List1
.AddItem "item1"
.AddItem "item2"
For i = 0 To .ListCount - 1
.Selected(i) = True
Next
End With
With ListBoxW1
.AddItem "item1"
.AddItem "item2"
For i = 0 To .ListCount - 1
.Selected(i) = True
Next
End With
End Sub
Result:
https://www.vbforums.com/images/ieimages/2023/11/2.png
That's a intended discrepancy indeed.
Use .ItemChecked instead. This way .Selected is "free" for it's normal purpose.
-
Re: CommonControls (Replacement of the MS common controls)
Thank a much Krool. I overlooked this property.
-
Re: CommonControls (Replacement of the MS common controls)
I can't find the OLEDragDrop event in the VBCCR17.RichTextBox (it's exposed in other VBCCR17 controls). There's instead a OLEDragDrop property that should enable the window as a OLE drop target but it doesn't actually do it. What am I doing wrong? Or is there a workaround for this? If there is one, can anyone provide an example? Thanks !
I'm running the VB6 Ide in a 64 bit Windows 10 OS.
-
Re: CommonControls (Replacement of the MS common controls)
Finally add the Ctrl+A keyboard shortcuts for the TextBoxW text field.
Is it really that difficult for you? I think many users are used to highlighting all the text using these hotkeys.
And Ctrl+A doesn't work for you in the executable file.
-
Re: CommonControls (Replacement of the MS common controls)
@HackerVlad:
Code:
Option Explicit
Private Declare Function GetKeyState Lib "user32.dll" (ByVal nVirtKey As Long) As Integer
Private Declare Function GetMem2 Lib "msvbvm60.dll" (Src As Any, Dst As Any) As Long
Private Const VK_CONTROL As Long = 17
Private m_bSkipDing As Boolean
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = Asc("A") Then
If HIWORD(GetKeyState(VK_CONTROL)) Then
SelectTextBox Me.ActiveControl
m_bSkipDing = True
End If
End If
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If m_bSkipDing Then KeyAscii = 0: m_bSkipDing = False
End Sub
Private Sub SelectTextBox(ctl As Control)
Dim txtB As VBCCR17.TextBoxW
If TypeOf ctl Is VBCCR17.TextBoxW Then
Set txtB = ctl
txtB.SelStart = 0
txtB.SelLength = Len(txtB.Text)
End If
End Sub
Public Function HIWORD(dwNum As Long) As Long
GetMem2 ByVal VarPtr(dwNum) + 2, HIWORD
End Function
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
HackerVlad
Finally add the Ctrl+A keyboard shortcuts for the TextBoxW text field.
The key combos CTRL+A, CTRL+C, CTRL+V and CTRL+X are working without any problems here in the TextBoxW control. Win10x64.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mith
The key combos CTRL+A, CTRL+C, CTRL+V and CTRL+X are working without any problems here in the TextBoxW control. Win10x64.
I have already realized that a manifest styles is required for this
-
Re: CommonControls (Replacement of the MS common controls)
This works for me:
Code:
Private Sub MyTextBoxW_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = Asc("A") And Shift = 2 Then
MyTextBoxW.SelStart = 0
MyTextBoxW.SelLength = Len(MyTextBoxW.Text)
End If
End Sub
-
Re: CommonControls (Replacement of the MS common controls)
Thank you all so much for the answers! I just wanted the author of the control to make keyboard shortcuts Ctrl+A
-
Re: CommonControls (Replacement of the MS common controls)
I have noticed that in the latest version of the ocx, the ClientTop of the tabstrip is not working properly.
now the interesting thing is that on a computer which the scale is set to 150% it works perfect, ClientTop is relative to the top of the form.
But on computers with the scale set to %100 ClientTop will be relative to the top of the tabstrip.
This issue did not exist in version 1.7.0.61, although i don't at which version it started
I left this message Here
so i have been reading a bit on the updates and I saw this.
09-Oct-2023
- TabStrip's ClientLeft/ClientTop now matches to VBA and to VBFlexGrid. (CellLeft/ClientLeft etc.)
So use .Left + .ClientLeft instead of just .ClientLeft for positioning from a container.
looks like its something to do with this
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Semke
I have noticed that in the latest version of the ocx, the ClientTop of the tabstrip is not working properly.
now the interesting thing is that on a computer which the scale is set to 150% it works perfect, ClientTop is relative to the top of the form.
But on computers with the scale set to %100 ClientTop will be relative to the top of the tabstrip.
This issue did not exist in version 1.7.0.61, although i don't at which version it started
I left this message
Here
so i have been reading a bit on the updates and I saw this.
09-Oct-2023
- TabStrip's ClientLeft/ClientTop now matches to VBA and to VBFlexGrid. (CellLeft/ClientLeft etc.)
So use .Left + .ClientLeft instead of just .ClientLeft for positioning from a container.
looks like its something to do with this
Yes. It was a design error.
Use TabStrip.Top + TabStrip.ClientTop.
Sorry for the inconvenience caused.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Yes. It was a design error.
Use TabStrip.Top + TabStrip.ClientTop.
Sorry for the inconvenience caused.
No apologies required, you are doing great work.
The reason I had different results on different computers is, because I had different versions of the OCX on these computer. Nothing to do with scaling.
Once again, Thank you for all the work.
-
Re: CommonControls (Replacement of the MS common controls)
how to set unicode text in vb6 ide (textw.ctl) and save it in UserControl_WriteProperties
韩文:한국어;英语:Korean
Just saw that there is a small button in the position of the property text. How did this happen?
It would be nice to replace the VB6 text box position directly with a new control that supports Korean UNICODE input
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
xiaoyao
how to set unicode text in vb6 ide (textw.ctl) and save it in UserControl_WriteProperties
Click the button "..." inside the text field property and enter your korean text in the property window.
-
Re: CommonControls (Replacement of the MS common controls)
Might be a silly question, but does anyone know of, or have created a utility to take in a VB6 project and convert all references from standard Microsoft controls to Krool's controls.
I have several large projects with 100-200 forms, that I'd like to convert to fully use Krool's controls, but doing this manually would take an age.
Thanks
Lee.
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
I haven't used Mountain Man's utilities, but simply did the manual, and indeed more time consuming conversion using Search & Replace in the form files using NotePad++. (My 3 key projects have 50-65 forms each.)
The "simple" controls like labels, buttons, frames, etc. are very straightforward to convert, and require no further attention. What I found though is that "more complex" controls like the TreeView and ListView also required code changes, since some of the events for them have new/different parameters. Also, some of the objects related to these controls, e.g. Nodes, have a different definition, which means underlying code may have to be updated.
After the conversion of the first project, I decided to create for the other two a grid with in the first column the forms, and then additional columns for each of the types of controls, with a tick if that type of control is on the form. That way I could quickly convert the "simple" forms, and was aware of which forms needed more attention in the form of a code review for the "special" controls.
-
Re: CommonControls (Replacement of the MS common controls)
Actually really intresting and fun to see this because in same era as I learned from EnumDeskVB which had dynamicly created sysListView32 and sysTreeView32 I was in the starting "how to make these into Shell controls". Due to a fatal disc crash (1999-2000) and no USB memory dongles and no back up on floppys back then I just left it. I worked out sysListView32, sysTreeView32 and ComboBoxEx32 as shellbrowsers back then but had no good SubClassing routine back then. When using more than one instance of the control of that time, it did only notified the first instance and the rest was "lame". Just memory and a recall...back then I was only the CCRP Project and no more. No GiT Hub or stuff like that. No MSDN Shell32 reference. Very much was "undocumented" and was only to find via certain books, web pages etc.
But it took really 11-12 years for it to become "resurrected" again. I had sysListView32, sysTreeView32, ComboBoxEx32 shellbrowser's as code samples at a webpage back then (1999-2000). I hade even Tab32, ProgressBar32 and some more But I didn't mind to work anymore on them. Thats just a little history about my experiance of the Common Controls.
-
Re: CommonControls (Replacement of the MS common controls)
Included the WindowedLabel control.
As the name says this control is not windowless and thus provides a hWnd property.
This can be useful for ZOrdering above other windowed controls or when a label control should be as a child control. (e.g. CoolBar etc.)
The BackStyle property is removed in the WindowedLabel and replaced by the Transparent property.
WM_PRINTCLIENT is supported for the WindowedLabel control.
Also WM_GETTEXTLENGTH/WM_GETTEXT/WM_SETTEXT is supported to replicate a "Static" class.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
xiaoyao
Can you add transparency properties to every newly invented, modern control?
Transparency and also rounded rect shape. These two additions would allow for more Win11-like interfaces.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
logley
Might be a silly question, but does anyone know of, or have created a utility to take in a VB6 project and convert all references from standard Microsoft controls to Krool's controls.
I have several large projects with 100-200 forms, that I'd like to convert to fully use Krool's controls, but doing this manually would take an age.
Thanks
Lee.
I use the free OCXUpdater tool from 10tec to quickly update OCXs: https://10tec.com/vb6-project-references-update/
Oh sorry - quickly read your post and misread it. The tool I mention is useful for updating from one version of an OCX to another one. For example, to upgrade from an older version of VBCCR to the new one. It doesn't do what you asked for.
-
Re: CommonControls (Replacement of the MS common controls)
Updating a project from VBCCR16 to VBCCR17, all of my existing VBCCR combo box widths have been auto-changed to 20 twips. Not a HUGE deal to address, just a little tedious. Thought you'd want to know.
Thanks for your continued support and excellent work on these controls!
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
AAraya
Updating a project from VBCCR16 to VBCCR17, all of my existing VBCCR combo box widths have been auto-changed to 20 twips. Not a HUGE deal to address, just a little tedious. Thought you'd want to know.
Thanks for your continued support and excellent work on these controls!
Thanks for reporting!
Bug is fixed. It was a recent stupid regression from 18-Dec-2023.
Sorry for this..
This bug affected also migration from VB.ComboBox to VBCCR17.ComboBoxW ..
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Included the WindowedLabel control.
As the name says this control is not windowless and thus provides a hWnd property.
This can be useful for ZOrdering above other windowed controls or when a label control should be as a child control. (e.g. CoolBar etc.)
The BackStyle property is removed in the WindowedLabel and replaced by the Transparent property.
WM_PRINTCLIENT is supported for the WindowedLabel control.
Also WM_GETTEXTLENGTH/WM_GETTEXT/WM_SETTEXT is supported to replicate a "Static" class.
That's fantastic, Krool.
Thanks a LOT.
Kind Regards.
-
Re: CommonControls (Replacement of the MS common controls)
Thank you, Krool, for this fantastic set of controls. I decided to convert my 20 years old project - and it looks like I am making relative quick progress.
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.
- 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 ?
-
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)