Page 88 of 94 FirstFirst ... 387885868788899091 ... LastLast
Results 3,481 to 3,520 of 3726

Thread: CommonControls (Replacement of the MS common controls)

  1. #3481
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    gridlines hide the pixels ot the first column of a subitem icon

    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:

    Name:  without grid lines.png
Views: 1419
Size:  1.6 KB

    when using .gridlines=true the pixels of the first column of the icon graphic is truncated/hidden:

    Name:  with grid lines.png
Views: 1377
Size:  1.7 KB

    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:

    Name:  dotted with gridlines.png
Views: 1431
Size:  1.8 KB

    without gridlines:

    Name:  dotted without gridlines.png
Views: 1423
Size:  1.9 KB

    the row height must increased automatically when gridlines are enabled to show the full dotted rectangle.
    Can this be fixed too?
    Last edited by Mith; Feb 2nd, 2023 at 11:25 AM.

  2. #3482

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Mith View Post
    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:

    Name:  without grid lines.png
Views: 1419
Size:  1.6 KB

    when using .gridlines=true the pixels of the first column of the icon graphic is truncated/hidden:

    Name:  with grid lines.png
Views: 1377
Size:  1.7 KB

    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:

    Name:  dotted with gridlines.png
Views: 1431
Size:  1.8 KB

    without gridlines:

    Name:  dotted without gridlines.png
Views: 1423
Size:  1.9 KB

    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.

    Quote Originally Posted by Dragokas View Post
    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.

  3. #3483
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: CommonControls (Replacement of the MS common controls)

    The item height will be adjusted if you adjust the image size.

  4. #3484
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Krool View Post
    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:

    Name:  MS listview NO grid lines.png
Views: 1425
Size:  1.0 KB Name:  MS listview grid lines.png
Views: 1416
Size:  1.3 KB

    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.

  5. #3485
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    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.

  6. #3486

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Mith View Post
    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?

  7. #3487
    Addicted Member
    Join Date
    Mar 2009
    Posts
    244

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Krool View Post
    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.

  8. #3488
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Krool View Post
    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.

  9. #3489
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by SuperDre View Post
    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.

  10. #3490
    Addicted Member
    Join Date
    Mar 2009
    Posts
    244

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Mith View Post
    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.

  11. #3491
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by SuperDre View Post
    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"...

  12. #3492
    Addicted Member
    Join Date
    Mar 2009
    Posts
    244

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Mith View Post
    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.

  13. #3493

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    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.

  14. #3494
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    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

  15. #3495

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Seniorchef View Post
    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.

  16. #3496
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    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.

  17. #3497
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    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

  18. #3498

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Seniorchef View Post
    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.

  19. #3499
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    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.

  20. #3500
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: CommonControls (Replacement of the MS common controls)

    Hello, Krool,
    are you planning to implement a scrollbar control into the CommonControls?
    Cheers

  21. #3501
    Member
    Join Date
    Feb 2023
    Posts
    32

    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.

  22. #3502

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Chris_G33 View Post
    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)

  23. #3503
    Member
    Join Date
    Feb 2023
    Posts
    32

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    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.

  24. #3504
    Member
    Join Date
    Mar 2020
    Posts
    33

    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

  25. #3505
    Member Dragokas's Avatar
    Join Date
    Aug 2015
    Location
    Ukraine
    Posts
    740

    Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Krool View Post
    Quote 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.
    Malware analyst, VirusNet developer, HiJackThis+ author || my CodeBank works

  26. #3506

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    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.

  27. #3507
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    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.

  28. #3508
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    445

    Lightbulb Re: gridlines hide the pixels ot the first column of a subitem icon

    Quote Originally Posted by Krool View Post
    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

  29. #3509
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    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.

  30. #3510
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    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

  31. #3511

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    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.

    Name:  TbrButtonMenuPicturePP.png
Views: 507
Size:  13.6 KB

    Name:  TbrButtonMenuPicture32bpp.png
Views: 600
Size:  27.3 KB

    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

  32. #3512

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    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.

    ?

  33. #3513
    Lively Member
    Join Date
    Oct 2014
    Posts
    93

    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!

  34. #3514

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    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)

  35. #3515
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    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.

  36. #3516
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    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.

  37. #3517
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    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

  38. #3518

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,374

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    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.

  39. #3519
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    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

  40. #3520
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by smileyoufu View Post
    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

Page 88 of 94 FirstFirst ... 387885868788899091 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width