-
Feb 2nd, 2023, 11:08 AM
#3481
Addicted Member
-
Feb 2nd, 2023, 03:22 PM
#3482
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Mith
VBCCR 1.7.47 & VB6SP6
I use the listview in report mode and added a icon (16x16) to a subitem.
when using .gridlines=false the icon is fully displayed:
when using .gridlines=true the pixels of the first column of the icon graphic is truncated/hidden:
Is it possible to fix this and show the full icon at subitems when gridlines are enabled?
The dotted rectangle is truncated when gridlines are enabled:
without gridlines:
the row height must increased automatically when gridlines are enabled to show the full dotted rectangle.
Can this be fixed too?
I looked into this and it seems that the ListView does not adjust by the gridlines. It act and draws like there is no gridline.
I never use gridlines and I am not aware of a solution.
 Originally Posted by Dragokas
Is it possible to bypass ListView limitation of item's max value length 259 characters?
Microsoft mscomctl.ocx doesn't have that limitation.
Code:
With listView1.ListItems.Add(1, , "Col1")
.SubItems(1) = String$(1000, "=")
Debug.Print Len(.SubItems(1)) 'returns 259, mscomctl.ocx unlimited
End With
That's a listview limitation. It can store more, see below code example, but it draws only the first 259 characters.
Code:
MsgBox Len(ListView1.ListItems.Add(, , String(500, "a")).Text) ' Returns 500
Last edited by Krool; Feb 2nd, 2023 at 03:27 PM.
-
Feb 2nd, 2023, 06:20 PM
#3483
Re: CommonControls (Replacement of the MS common controls)
The item height will be adjusted if you adjust the image size.
-
Feb 3rd, 2023, 10:16 PM
#3484
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Krool
I looked into this and it seems that the ListView does not adjust by the gridlines. It act and draws like there is no gridline. I never use gridlines and I am not aware of a solution.
I tested the grid line problem with the MS listview and i got the same results:

It looks like the devs just drawed the grid lines into the current cell space without extending the cell space for each drawed line.
Another unsolved bug of the MS controls.
-
Feb 15th, 2023, 08:12 PM
#3485
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
VBCCR 1.7.47 & VB6SP6
Hi Krool,
i use the listview in report mode with 6 columns.
Some user get error "9 - Subscript out of range" at the line "If xItem.ListSubItems(4).Tag = 0 Then" in the mouse move event.
How is this possible if i use a "select case" with "case 4"?
The error occurred on Windows 10 (Build 19045). I cant reproduce this error myself.
Check my code:
Code:
Private Sub lvwSource_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim subItemIndex As Long
Dim xItem As VBCCR17.LvwListItem
Set xItem = lvwSource.HitTest(X, Y, subItemIndex)
If xItem Is Nothing Then
...
Else
Select Case subItemIndex
Case 0
...
Case 4
If xItem.ListSubItems(4).Tag = 0 Then
...
Else
...
End If
End Select
End If
End Sub
Last edited by Mith; Feb 15th, 2023 at 08:57 PM.
-
Feb 15th, 2023, 11:59 PM
#3486
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Mith
VBCCR 1.7.47 & VB6SP6
Hi Krool,
i use the listview in report mode with 6 columns.
Some user get error "9 - Subscript out of range" at the line "If xItem.ListSubItems(4).Tag = 0 Then" in the mouse move event.
How is this possible if i use a "select case" with "case 4"?
The error occurred on Windows 10 (Build 19045). I cant reproduce this error myself.
Check my code:
Code:
Private Sub lvwSource_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim subItemIndex As Long
Dim xItem As VBCCR17.LvwListItem
Set xItem = lvwSource.HitTest(X, Y, subItemIndex)
If xItem Is Nothing Then
...
Else
Select Case subItemIndex
Case 0
...
Case 4
If xItem.ListSubItems(4).Tag = 0 Then
...
Else
...
End If
End Select
End If
End Sub
Hard to tell.
But if you have let's say 10 column header it doesn't mean automatically that each list item hast 9 sub items.
Are you sure that These are added in all cases?
-
Feb 16th, 2023, 03:30 AM
#3487
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Krool
Hard to tell.
But if you have let's say 10 column header it doesn't mean automatically that each list item hast 9 sub items.
Are you sure that These are added in all cases?
I encountered something like this with the original Listview, if you haven't set the SubItem(4) string it won't automatically create the ListSubItem(4) item, and it is dependent on the listitem itself.
-
Feb 16th, 2023, 03:36 AM
#3488
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Krool
Hard to tell.
But if you have let's say 10 column header it doesn't mean automatically that each list item hast 9 sub items.
Are you sure that These are added in all cases?
I checked my "AddListItem"-function twice and yes, all subitems will always be added and filled with a value.
Doesnt the HitTest-function at my code proof that the subitem exist?
Or why does the HitTest-function returns subItemIndex=4 if it not exist?
Maybe the HitTest-function dont care if a subitem exists and only returns the number of the subitem because of the x/y-position?
Last edited by Mith; Feb 16th, 2023 at 03:55 AM.
-
Feb 16th, 2023, 03:53 AM
#3489
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by SuperDre
I encountered something like this with the original Listview, if you haven't set the SubItem(4) string it won't automatically create the ListSubItem(4) item, and it is dependent on the listitem itself.
At my VBCCR listview i add 2 subitems without text ("") because i only show a icon in this columns and i never run into a problem.
-
Feb 16th, 2023, 07:41 AM
#3490
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Mith
At my VBCCR listview i add 2 subitems without text ("") because i only show a icon in this columns and i never run into a problem.
But you set it. Setting it with an empty string is already enough, but do something like this If MyValue <> "" then Listitem.SubItem(x) = MyValue , any SubItem where MyValue = "" will give you an Index out of bounds when trying to do something with the Listitem.ListSubItem(x). Again, that is what I even ran into this week when trying to add some ForeColor to a line in a certain situation, anytime I had If MyValue <> "" then Listitem.SubItem(x) = MyValue and immediately after that did ListItem.ListSubItem(x).ForeColor=vbRed I got an error. Never knew this before as I normally just do Listitem.SubItem(x)=MyValue without the checking for an empty string.
-
Feb 16th, 2023, 10:31 AM
#3491
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by SuperDre
But you set it. Setting it with an empty string is already enough, but do something like this If MyValue <> "" then Listitem.SubItem(x) = MyValue , any SubItem where MyValue = "" will give you an Index out of bounds when trying to do something with the Listitem.ListSubItem(x). Again, that is what I even ran into this week when trying to add some ForeColor to a line in a certain situation, anytime I had If MyValue <> "" then Listitem.SubItem(x) = MyValue and immediately after that did ListItem.ListSubItem(x).ForeColor=vbRed I got an error. Never knew this before as I normally just do Listitem.SubItem(x)=MyValue without the checking for an empty string.
Do you still talk about the original MS listview? I cant reproduce the problem you described with the VBCCR17 listview control.
I have to subitems without text and i recieve no error when i access the subitems with "Item.ListSubItems(x).Tag"...
-
Feb 16th, 2023, 12:05 PM
#3492
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Mith
Do you still talk about the original MS listview? I cant reproduce the problem you described with the VBCCR17 listview control.
Original listview, I'm still not using the VBCCR library.
-
Feb 17th, 2023, 02:02 AM
#3493
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Semke
On the toolbar Button the Style Placeholder is missing. So what I have been using until now is, to set the style as TbrButtonStyleSeparator and set the CustomWidth to the desired width.
Seems ok, But! when the toolbar Wrappable is true the button will not go immediately to the next row of the toolbar. Only after a button with the style is not TbrButtonStyleSeparator which is before the placeholder has also been moved to the next row
when checking the Button .Left and .Top properties it returns 0 on both, as a result any controls which are dependent on these coordinates move to position 0,0
This will also be if there are more then one placeholders in sequence; they will not move to next row of buttons until the wrap include the button before all the placeholder(s).
I hope I explained it enough...
to test it , create a toolbar with a few buttons, create a button TbrButtonStyleSeparator and set Customwidth to 2000, Autosize= false , create a few more buttons. set toolbar Wrappable =true
create a picturbox
in code
set Picturebox Container = toolbar
set the picturebox cords to the button cords
resize the form to the middle of the placeholder and repeat setting the picturebox cords to the button cords (use a form resize event to see it better)
I have tested it further.
if i put a TbrButtonStyleSeparator with Autosize=true before the placeholder then the .Left and .Top properties remain as old, but it will not move dow until all buttons with TbrButtonStyleSeparator in the sequence don't fit on the row
I tested this and confirm.
When a tool bar wraps, tool items with the style BTNS_SEP are used as wrap points.. So I could fixed this one by simply changing TbrButtonStyleSeparator to TbrButtonStyleDefault and the Enabled = False.
-
Feb 20th, 2023, 03:40 AM
#3494
Member
Re: CommonControls (Replacement of the MS common controls)
Hello, Krool!
In the ComboBoxW control there is no Procedure-ID 0 (Default) for the control. This should be the Text property.
Greetings
-
Feb 20th, 2023, 04:10 AM
#3495
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Seniorchef
Hello, Krool!
In the ComboBoxW control there is no Procedure-ID 0 (Default) for the control. This should be the Text property.
Greetings
There is a default "Default" property in ComboBoxW. It is linked to the Text property.
-
Feb 20th, 2023, 11:11 AM
#3496
Member
Re: CommonControls (Replacement of the MS common controls)
to be more elaborated
deleted by seniorchef
Last edited by Seniorchef; Feb 20th, 2023 at 11:30 AM.
-
Feb 20th, 2023, 11:38 AM
#3497
Member
Re: CommonControls (Replacement of the MS common controls)
Ok, now I see. You gave the property "Default" the Procedure-ID: 0.
But as I understand this feature, the default Property should be as in the "Checkbox = 2" instead of "CheckBox.Value = 2" and so on. Your other controls do like that.
I don't see the advantage for cmbW.Default = "anytext" over cmbW.Text = "anytext".
Greetings
-
Feb 21st, 2023, 05:10 AM
#3498
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Seniorchef
Ok, now I see. You gave the property "Default" the Procedure-ID: 0.
But as I understand this feature, the default Property should be as in the "Checkbox = 2" instead of "CheckBox.Value = 2" and so on. Your other controls do like that.
I don't see the advantage for cmbW.Default = "anytext" over cmbW.Text = "anytext".
Greetings
Why you can't do cmbW = "anytext" ? It should be working.
-
Feb 23rd, 2023, 05:28 AM
#3499
Member
Re: CommonControls (Replacement of the MS common controls)
I used a Version from of the demo, and that version was older. And I didn't look at the "default" property (in that old version there is no default property, so you can imagine how old it was). I was fixed too much on the Text-Property. Sorry for that.
Out of curiosity: why not take the Text property as default?
Cheers
Last edited by Seniorchef; Feb 23rd, 2023 at 09:58 AM.
-
Feb 25th, 2023, 01:35 PM
#3500
Member
Re: CommonControls (Replacement of the MS common controls)
Hello, Krool,
are you planning to implement a scrollbar control into the CommonControls?
Cheers
-
Mar 21st, 2023, 12:36 PM
#3501
Junior Member
Re: CommonControls (Replacement of the MS common controls)
Why are the value, min and max of the progress bar only longs, and not single as the VB ones?
I need single value types for my project.
-
Mar 21st, 2023, 02:07 PM
#3502
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Chris_G33
Why are the value, min and max of the progress bar only longs, and not single as the VB ones?
I need single value types for my project.
Oh, ok. Well why you need single? You could x100 the long values to get them more fine grained. (Like 2 digits after decimal point)
-
Mar 22nd, 2023, 09:24 AM
#3503
Junior Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
Oh, ok. Well why you need single? You could x100 the long values to get them more fine grained. (Like 2 digits after decimal point)
Well, in my app the max can be just 10 or 10 000 000 000
Sure, I can add a factor in case I need such large values.
-
Mar 27th, 2023, 11:03 AM
#3504
New Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
I get a problem with the Dir Function in the Common.Bas
I've got 2 PCs, PC1 runs Windows 7 and PC2 runs Windows 11.
When in the IDE I do
Code:
debug.print dir("\\PCWIN11\Crapahute\Documents\VB\Test_VBCCR\INF\SQLUPD-BN*.inf",vbnormal)
on both PCs, I get the first file begining with SQLUPD-BN
Then, if I do
Code:
debug.print dir("\\PCWIN11\Crapahute\Documents\VB\Test_VBCCR\INF\SQLUPD-BN Z*.inf",vbnormal)
knowing that there is no file begining with SQLUPD-BN Z
I get "" on the PC running Windows 11
but on the PC running Windows 7, I get error 52
If I do the same command using the VB Dir command, I get "" and no error.
So I have to comment this line in your code in Common.Bas :
Code:
Public Function Dir(Optional ByVal PathMask As String, Optional ByVal Attributes As VbFileAttribute = vbNormal) As String
[...]
AttributesCache = Attributes
If Left$(PathMask, 2) = "\\" Then PathMask = "UNC\" & Mid$(PathMask, 3)
hFindFile = FindFirstFile(StrPtr("\\?\" & PathMask), FD)
If hFindFile = INVALID_HANDLE_VALUE Then
hFindFile = 0
' If Err.LastDllError > 12 Then Err.Raise 52 ' <<< needs to comment
Exit Function
End If
[...]
End Function
Maybe it's something I do wrong.
Thank you
-
Apr 9th, 2023, 12:30 PM
#3505
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Krool
 Originally Posted by Dragokas
Is it possible to bypass ListView limitation of item's max value length 259 characters?
Microsoft mscomctl.ocx doesn't have that limitation.
Code:
With listView1.ListItems.Add(1, , "Col1")
.SubItems(1) = String$(1000, "=")
Debug.Print Len(.SubItems(1)) 'returns 259, mscomctl.ocx unlimited
End With
That's a listview limitation. It can store more, see below code example, but it draws only the first 259 characters.
Code:
MsgBox Len(ListView1.ListItems.Add(, , String(500, "a")).Text) ' Returns 500
There is no problem with 1st column.
The problem exists when you try to retrive the data from column 2, 3 e.t.c., as specially shown in my example, using SubItems method.
I'll double, that mscomctl has no such restriction.
Thank you.
-
Apr 14th, 2023, 01:01 PM
#3506
Re: CommonControls (Replacement of the MS common controls)
Update released.
Bugfix that the caret is not scrolled into view on SelStart/SelLength in the TextBoxW/RichTextBox control.
-
Apr 15th, 2023, 02:10 PM
#3507
Re: CommonControls (Replacement of the MS common controls)
If each control can set the background image, or automatically copy the image of the parent object in that area. \n 。 It is also very good to achieve a false transparent effect.
-
Apr 17th, 2023, 09:13 PM
#3508
Addicted Member
Re: gridlines hide the pixels ot the first column of a subitem icon
 Originally Posted by Krool
Hard to tell.
But if you have let's say 10 column header it doesn't mean automatically that each list item hast 9 sub items.
Are you sure that These are added in all cases?
If someone runs into the same problem: i fixed the problem with the additional code "If xItem.ListSubItems.Exists(subItemIndex) = True Then" to make sure the subitem exists before access:
Code:
Private Sub lvwSource_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim subItemIndex As Long
Dim xItem As VBCCR17.LvwListItem
Set xItem = lvwSource.HitTest(X, Y, subItemIndex)
If xItem Is Nothing Then
...
ElseIf xItem.ListSubItems.Exists(subItemIndex) = True Then
Select Case subItemIndex
Case 0
...
Case 4
If xItem.ListSubItems(4).Tag = 0 Then
...
Else
...
End If
End Select
End If
End Sub
-
Apr 21st, 2023, 11:30 AM
#3509
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
PROGRESSBAR QUESTION
When a VBCCR ProgressBar is set to VisualStyles = True, it rarely shows, for example, 60/100.
This is seen when the whole process from 0 to 100% is relatively fast.
If 100% is reached, then the ProgressBar is set to Visible = False.
It looks like the 100% value ends at e.g. 30% of the bar width.
I guess this is because the VisualStyles want to show the next value smoothly.
The same situation with VisualStyles = False shows the expected behavior, at least for a short moment.
The question(s):
Can we adjust the 'smoothing' time in the control itself somehow?
If not, is there a method to force the the update?
If the above is not possible, I could live without the VisualStyles.
But I don't like the control border.
How is it possible to remove the border?
There is no BorderStyle property or similar.
-
Apr 24th, 2023, 03:26 AM
#3510
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
But I don't like the control border.
@Krool
I've found a solution.
But I'm not very sure if removing WS_EX_STATICEDGE wouldn't harm somewhere down the road.
What do you think?
Code:
Public Property Let VisualStyles(ByVal Value As Boolean)
PropVisualStyles = Value
If ProgressBarHandle <> 0 And EnabledVisualStyles() = True Then
Dim dwExStyle As Long, dwExStyleOld As Long
dwExStyle = GetWindowLong(hWnd, GWL_EXSTYLE)
dwExStyleOld = dwExStyle
If PropVisualStyles = True Then
ActivateVisualStyles ProgressBarHandle
If (dwExStyle And WS_EX_STATICEDGE) = WS_EX_STATICEDGE Then dwExStyle = dwExStyle And Not WS_EX_STATICEDGE
Else
RemoveVisualStyles ProgressBarHandle
'If Not (dwExStyle And WS_EX_STATICEDGE) = WS_EX_STATICEDGE Then dwExStyle = dwExStyle Or WS_EX_STATICEDGE
End If
If dwExStyle <> dwExStyleOld Then
SetWindowLong ProgressBarHandle, GWL_EXSTYLE, dwExStyle
Call ComCtlsFrameChanged(ProgressBarHandle)
End If
Me.Refresh
End If
UserControl.PropertyChanged "VisualStyles"
End Property
-
May 10th, 2023, 08:02 AM
#3511
Re: CommonControls (Replacement of the MS common controls)
Update released.
Long overdue Picture support added for the Button Menus in the ToolBar control.
It only accepts bitmaps. But you can use 32bpp alpha bitmaps to achieve transparancy.


The OCX VBCCR17 was also updated. The internal type lib version is now 1.3.
Code:
Object={7020C36F-09FC-41FE-B822-CDE6FBB321EB}#1.3#0; VBCCR17.OCX
-
May 13th, 2023, 07:22 AM
#3512
Re: CommonControls (Replacement of the MS common controls)
Question.
Should I allow to set pictures in the Button Menus in the ToolBar control which are not of type 'Bitmap' ?
Supporting of other pictures types would require HBMMENU_CALLBACK.
Downside is that the menu theme is removed when some menu item has hBmpItem set to HBMMENU_CALLBACK.
So the behavior is then if somebody only uses 32-bit pre-multiplied alpha RGB bitmaps he get the best result as menu theme is preserved.
If somebody uses for example normal icons the menu theme would be lost.
?
-
May 15th, 2023, 06:21 AM
#3513
Lively Member
Re: CommonControls (Replacement of the MS common controls)
Krool, thank you very much for providing the great CommonControls control!
If possible, we would like to add support for ". png" files in the "Toolbar" and "ImageList"...
Thanks again!
-
May 17th, 2023, 04:01 AM
#3514
Re: CommonControls (Replacement of the MS common controls)
Update released.
Support of icons and metafiles for the Picture property in the TbrButtonMenu of the ToolBar control.
However, selecting such a picture file (design-time) will show a warning message that the menu theme will be removed. (HBMMENU_CALLBACK)
-
May 17th, 2023, 04:30 PM
#3515
Re: CommonControls (Replacement of the MS common controls)
How to develop your own transparent controls What UI components implement transparency
Hope to increase the transparency of each control function, one is to use the principle of WINDOWS transparent layer to achieve, with no less than WIN8 operating system. For example, if you use a transparent PNG image of a squiggly moon, you can also transparently see the controls behind it.
The other is to copy the background image to achieve false transparency. The background image needs to be re-copied after the control is resized or moved.
windows seems to use a background brush feature, such as setting the background image. If the control is placed on a form and the background brush is the background image of the form, transparency is automatically implemented.
Re-developed a set of standard controls instead of VB6 enterprise edition, the workload is quite large, if can become a modern style, more and more beautiful, that should be good.
-
May 17th, 2023, 04:35 PM
#3516
Re: CommonControls (Replacement of the MS common controls)
Dear post owner, with respect to your great work, I wonder why you developed this suite in the first place and why you even thought of implementing such a full control replacement development. 34 controls. That's a lot of power.
Maybe because the enterprise edition controls charge? Or is it because WINDOWS controls are old and want to add more beautiful and powerful features to them? At the beginning, I only wanted to develop 3-5 controls, and then slowly changed to nearly 40 controls?
Tell me about the reasons for creating this great product, and some interesting stories about how you became a programmer?
Last edited by xiaoyao; May 17th, 2023 at 04:39 PM.
-
May 17th, 2023, 06:34 PM
#3517
Re: CommonControls (Replacement of the MS common controls)
The text box transparent components do a module, direct call, very convenient. Support for adding multiple text boxes, and I wonder what other standard controls can be made transparent in this way.
Code:
Set TransparentControl1 = New TransparentTextBox
TransparentControl1.AddHook Text1, Me.hwnd
or
Code:
TransparentControl1.AddObj Text1
TransparentControl1.AddObj Text2
TransparentControl1.AddObj Text3
TransparentControl1.StartHookControlList Form1.hwnd
Code:
TransparentTextBox.cls
'need clsTrickSubclass
Option Explicit
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Type RECT
iLeft As Long
iTop As Long
iRight As Long
iBottom As Long
End Type
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function RedrawWindow Lib "user32" (ByVal hwnd As Long, lprcUpdate As Any, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As Any) As Long
Private Declare Function MapWindowPoints Lib "user32" (ByVal hwndFrom As Long, ByVal hwndTo As Long, lppt As Any, ByVal cPoints As Long) As Long
Private Declare Function ExcludeClipRect Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_EX_TRANSPARENT As Long = &H20&
Private Const NULL_BRUSH As Long = 5
Private Const TRANSPARENT As Long = 1
Private Const WM_NCHITTEST As Long = &H84
Private Const WM_CTLCOLOREDIT As Long = &H133
Private Const RDW_INVALIDATE As Long = &H1
Private Const RDW_UPDATENOW As Long = &H100&
Private Const RDW_ALLCHILDREN As Long = &H80
Dim WithEvents mSubclass As clsTrickSubclass
Dim mIsCancel As Boolean
Public StopUpdate As Boolean
Dim ControlHwnd As Long
Dim Text1 As Control
Dim ObjList As Collection
Sub AddObj(obj As Control)
ObjList.Add obj, "" & ObjList.Count
End Sub
Sub StartHookControlList(FormHwnd As Long)
'Enable transparency for multiple controls
For Each Text1 In ObjList
ControlHwnd = Text1.hwnd
SetWindowLong ControlHwnd, GWL_EXSTYLE, GetWindowLong(ControlHwnd, GWL_EXSTYLE) Or WS_EX_TRANSPARENT
Next
Set ObjList = Nothing
Set mSubclass = New clsTrickSubclass
's american-american-American-American-American-American-American-American-American-American-American-American-American-
mSubclass.Hook FormHwnd
End Sub
'Sub ReDraw()
"" Eliminate border contamination
' Text1.BorderStyle = 0
' Text1.BorderStyle = 1
"" Or the one below
' 'ShowScrollBar Text1.hwnd, SB_HORZ, True
' 'ShowScrollBar Text1.hwnd, SB_HORZ, False
'
'
Redraw the background image
' Text1.Refresh
'End Sub
Sub AddHook(Text1A As Object, FormHwnd As Long)
Set Text1 = Text1A
ControlHwnd = Text1.hwnd
SetWindowLong ControlHwnd, GWL_EXSTYLE, GetWindowLong(ControlHwnd, GWL_EXSTYLE) Or WS_EX_TRANSPARENT
Set mSubclass = New clsTrickSubclass
's american-american-American-American-American-American-American-American-American-American-American-American-American-
mSubclass.Hook FormHwnd
End Sub
Private Sub Class_Initialize()
Set ObjList = New Collection
End Sub
Private Sub Class_Terminate()
mSubclass.UnHook
End Sub
Private Sub mSubclass_WndProc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long, Ret As Long, DefCall As Boolean)
Select Case Msg
Case WM_CTLCOLOREDIT
'hwnd is me.hwnd -- lParam is Text1.hwnd
Static RC As RECT
Static isRedraw As Boolean 'Parent redraw flag
'If the parent redraw flag is not set, redraw the background below
If Not isRedraw And Not StopUpdate Then
'Projects the coordinates of the work area onto the parent object
GetClientRect lParam, RC 'original
'GetWindowRect lParam, RC
MapWindowPoints lParam, hwnd, RC, 2
'Draws the parent background below the text box
isRedraw = True
RedrawWindow hwnd, RC, 0, RDW_INVALIDATE Or RDW_UPDATENOW Or RDW_ALLCHILDREN
isRedraw = False
'Exclude the entire area because text was rendered on the previous call
ExcludeClipRect wParam, 0, 0, RC.iRight, RC.iBottom
Else
Debug.Print "ignore"
End If
'Set the transparent brush and text background type
SetBkMode wParam, TRANSPARENT
Ret = GetStockObject(NULL_BRUSH)
'Case WM_NCHITTEST: Ret = HTCAPTION 'Drag anywhere
Case Else: DefCall = True
End Select
End Sub
-
May 18th, 2023, 05:42 AM
#3518
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
Update released.
Support of icons and metafiles for the Picture property in the TbrButtonMenu of the ToolBar control.
However, selecting such a picture file (design-time) will show a warning message that the menu theme will be removed. (HBMMENU_CALLBACK)
Just as a hint. I use IcoFx 1.64 (last freeware version) load any of your favorite icons and export your selected icon frame as 32bpp pARGB bitmap.
This way you can easily convert your icons and apply them to your toolbar and they appear as if icons. But this way you don't loose menu theme.
-
May 19th, 2023, 12:32 PM
#3519
Lively Member
Re: CommonControls (Replacement of the MS common controls)
There is a run-time error #383 "Property is read-only" in the last line of the ComCtlsDemo(4/14/2023).RichTextBoxForm.Form_Load sub:
Code:
FontCombo1.Text = RichTextBox1.SelFontName
-
May 19th, 2023, 12:45 PM
#3520
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by smileyoufu
Krool, thank you very much for providing the great CommonControls control!
If possible, we would like to add support for ". png" files in the "Toolbar" and "ImageList"...
Thanks again!
If it can be set, directly turn it into a resource PNG image file, or directly reference the virtual path under the current directory. \img\001.png
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|