Page 71 of 94 FirstFirst ... 21616869707172737481 ... LastLast
Results 2,801 to 2,840 of 3726

Thread: CommonControls (Replacement of the MS common controls)

  1. #2801
    Lively Member
    Join Date
    Oct 2016
    Posts
    108

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by OldClock View Post
    Kr00l I'm having an issue with the CommonDialog. I placed one on MDIForm1, then I need to use it from some module:
    Code:
        Dim cDlg As VBCCR16.CommonDialog
        Set cDlg = MDIForm1.ComDlg
    This results in:


    Same if I do:
    Code:
        Dim cDlg As CommonDialog
        Set cDlg = MDIForm1.ComDlg
    I now looked inside MDIForm1.frm and see this:
    Code:
       Begin MSComDlg.CommonDialog ComDlg
    How do I place a VBCCR16 CommonDialog instead of a MSComDlg? I only have one CommonDialog button in the Toolbox...
    Attachment 177023
    in mdiForm
    Code:
    Public cDlogM As VBCCR16.CommonDialog
    in user Form/Module
    Code:
    Dim cDlogF As VBCCR16.CommonDialog
    
    Set  MDIForm1.cDlogM  = New VBCCR16.CommonDialog
    set cDlogF = MDIForm1.cDlogM
    Last edited by Semke; May 15th, 2020 at 05:31 AM.

  2. #2802
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: CommonControls (Replacement of the MS common controls)

    Bug Report: ListView, whether listitems exist or not
    - when listview is shown and has 2+ column headers, remove all but one
    - re-add 1 or 2 column headers
    - Subscript out of Range error

    I think the control is trying to redraw somewhere between the column header being added, but the header not being appended to the collection yet.

    Updated: I don't know if this was the right thing to do or not, but solved the problem...
    Class: lvwColumnHeaders
    Method: Add
    Action: moved the "ShadowListView.FColumnHeadersAdd" call to end of method

    -----------------------------------------------------------------------------------------------

    Have an option for you. Not just reporting bugs!

    Been playing with your ListView and found something lacking . I noticed you added several types of sorting options, but didn't include the one I was looking for... Explorer-like sorting when text & numeric listitems are intermixed. Suggestion follows.
    Code:
    Private Declare Function StrCmpLogicalW Lib "shlwapi" (ByVal psz1 As Long, ByVal psz2 As Long) As Long
    
    Private Function ListItemsSortingFunctionLogical(ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
        Dim Text1 As String, Text2 As String
        Text1 = Me.FListItemText(lParam1 + 1, PropSortKey)
        Text2 = Me.FListItemText(lParam2 + 1, PropSortKey)
        ListItemsSortingFunctionLogical = StrCmpLogicalW(StrPtr(Text1), StrPtr(Text2))
        If PropSortOrder = LvwSortOrderDescending Then ListItemsSortingFunctionLogical = -ListItemsSortingFunctionLogical
    End Function
    edited: sample of differences, logical compare on the left side
    2string 20string
    3string 2string
    20string 3string
    st2ring st20ring
    st3ring st2ring
    st20ring st3ring
    string2 string2
    string3 string20
    string20 string3
    Last edited by LaVolpe; May 16th, 2020 at 06:52 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #2803
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: CommonControls (Replacement of the MS common controls)

    Edited. Following is not a bug per-se. Behavior in the VB usercontrols does the same. A misunderstanding on my part, thinking that deleting a column removed the column contents. It does not, it just removes the column and hides the far right visible subitem.

    Krool, found another bug.

    This one will take a bit more work. When a listview column is removed, you shift all subitems left one. That only works if the last subitem was the one removed. In your sample project, try removing column 2 (subitem 1). The column headers shift correctly, but the subitems do not.

    Updated. May have fixed it, but unsure. I think you need to take a closer look at what happens to subitems when columns are added/removed during runtime on populated listviews.

    UC: ListView

    Method: FColumnHeadersAdd
    Action: call RebuildListItems, passing current column header count. If you are inserting columns in listsubitems for new columns vs. always appending, then I'd imagine you want to pass the new index instead

    Method: FColumnHeadersRemove
    Action: call RebuildListItems, passing the subitem index to be removed as a negative value. This is called before SetColumnsSubItemIndex, not after

    Method: RebuildListItems
    Action: added Index parameter and tweaked a little code:
    Code:
            If .FListSubItemsCount > 0 Then
                If Index = Count Then   ' adding new column
                    ' however you want to handle this, I didn't look at it
                ElseIf -Index < Count Then
                    .ListSubItems.Remove -Index
                End If
            End If
    Last edited by LaVolpe; May 17th, 2020 at 10:48 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #2804

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by LaVolpe View Post
    Bug Report: ListView, whether listitems exist or not
    - when listview is shown and has 2+ column headers, remove all but one
    - re-add 1 or 2 column headers
    - Subscript out of Range error

    I think the control is trying to redraw somewhere between the column header being added, but the header not being appended to the collection yet.

    Updated: I don't know if this was the right thing to do or not, but solved the problem...
    Class: lvwColumnHeaders
    Method: Add
    Action: moved the "ShadowListView.FColumnHeadersAdd" call to end of method
    The fix as you suggested is OK. However, I would like to replicate the problem to look for another potential issue.
    But I couldn't replicate. Can you bundle a small demo?


    Quote Originally Posted by LaVolpe View Post
    I noticed you added several types of sorting options, but didn't include the one I was looking for... Explorer-like sorting when text & numeric listitems are intermixed.
    Thanks. Will include sort option StrCmpLogicalW soon.

    Quote Originally Posted by LaVolpe View Post
    When a listview column is removed, you shift all subitems left one. That only works if the last subitem was the one removed. In your sample project, try removing column 2 (subitem 1). The column headers shift correctly, but the subitems do not.
    The MS ListView behaves exactly the same. So I do not consider this being a "bug". Thanks however for your testing.

  5. #2805
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The fix as you suggested is OK. However, I would like to replicate the problem to look for another potential issue.
    But I couldn't replicate. Can you bundle a small demo?
    I used your demo in post #1. I added 2 new test buttons with code below. Note. Setting .Redraw=False also prevents the error.
    Code:
    ' button to remove listitems & column headers
    Dim n&
    ListView1.ListItems.Clear
    For n = ListView1.ColumnHeaders.Count To 2 Step -1
        ListView1.ColumnHeaders.Remove n
    Next
    
    ' button to re-add columns & errors
    ListView1.ColumnHeaders.Add , , "NewCol"
    ListView1.ColumnHeaders.Add , , "NewCol2"
    The MS ListView behaves exactly the same. So I do not consider this being a "bug". Thanks however for your testing.
    Wow, never really noticed. I was assuming it would react similar to deleting a column from an Excel sheet. But v6 of the Listview doesn't shift column contents when headers are removed. I should've been using the .ListSubItems.Remove method of each listview item to produce the results I expected. With old age no longer creeping up, it has settled in, wonder if this is something I re-learned?
    Last edited by LaVolpe; May 17th, 2020 at 10:52 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #2806
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: CommonControls (Replacement of the MS common controls)

    For what it's worth, if a post is in the wrong thread, you can just report it, as the mods can move the post to the right thread, as long as we know which thread is the right thread.
    My usual boring signature: Nothing

  7. #2807

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by LaVolpe View Post
    I used your demo in post #1. I added 2 new test buttons with code below. Note. Setting .Redraw=False also prevents the error.
    Code:
    ' button to remove listitems & column headers
    Dim n&
    ListView1.ListItems.Clear
    For n = ListView1.ColumnHeaders.Count To 2 Step -1
        ListView1.ColumnHeaders.Remove n
    Next
    
    ' button to re-add columns & errors
    ListView1.ColumnHeaders.Add , , "NewCol"
    ListView1.ColumnHeaders.Add , , "NewCol2"
    I still tested on Windows 7 where it does not happen.
    I tested now on Windows 10 and it crashes upon CDDS_ITEMPREPAINT on the Header Control, which makes sense.

    I will make an update as you suggested in the ColumnHeaders::Add method to shift the FColumnHeadersAdd after it has been added to the Collection.

    EDIT: Bugfix applied.
    Last edited by Krool; May 17th, 2020 at 01:08 PM.

  8. #2808
    Addicted Member
    Join Date
    Jul 2016
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    Hey

    1. How can I check whether a vertical scrollbar has appeared in a listview? I want to resize column widths if a vertical scrollbar appear.

    2. Is it possible to allow a vertical scrollbar to appear when needed, but not a horizontal scrollbar?
    P.S. I am aware of ShowScrollBar, but when I use it to hide the horizontal scrollbar then visual artifacts appear in the bottom row where the scrollbar would have been, and the horizontal scrollbar appears anyway when I scroll vertically.

    While trying to find a solution, I encountered some odd behavior, can't say whether they're bugs or not:

    3.
    Sub ComputeControlSize(VisibleCount As Long, Width As Single, Height As Single, [ProposedWidth As Single], [ProposedHeight As Single])
    Member of VBCCR16.ListView
    A method that returns the width and height for a given number of visible list items.
    Code:
        Dim ww As Single
        Dim hh As Single
        Call lv.ComputeControlSize(20, 5295, 2475, ww, hh)
        Debug.Print "ww: " & ww & ", hh: " & hh
    This always prints 0. The LV's width is 5295 twips, height is 2475, using View=LvwViewReport. Since the LV at that font size can only show 11 rows, and I set the VisibleCount parameter to 20 (I also tried with just 1), I would expect the computed vertical size to be larger than 2475.

    4.
    Function GetVisibleCount() As Long
    Member of VBCCR16.ListView
    Returns the number of fully visible list items. If the list view is in 'icon', 'small icon' or 'tile' view then the return value is the total number of list items.
    I added 4 ListItems to that LV, but Debug.Print lv.GetVisibleCount prints 11. There are 11 fully-visible rows, but only 4 ListItems. The description is misleading.
    Last edited by OldClock; May 19th, 2020 at 11:05 AM.

  9. #2809

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by OldClock View Post
    3.
    Code:
        Dim ww As Single
        Dim hh As Single
        Call lv.ComputeControlSize(20, 5295, 2475, ww, hh)
        Debug.Print "ww: " & ww & ", hh: " & hh
    This always prints 0. The LV's width is 5295 twips, height is 2475, using View=LvwViewReport. Since the LV at that font size can only show 11 rows, and I set the VisibleCount parameter to 20 (I also tried with just 1), I would expect the computed vertical size to be larger than 2475.
    You flipped the params. You should call as following:

    Code:
    Dim ww As Single
    Dim hh As Single
    Call lv.ComputeControlSize(20, ww, hh, 5295, 2475)
    Or omitting proposed width/height:
    Code:
    Dim ww As Single
    Dim hh As Single
    Call lv.ComputeControlSize(20, ww, hh)

  10. #2810
    Addicted Member
    Join Date
    Jul 2016
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    That works, thanks Krool.

  11. #2811

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by OldClock View Post
    1. How can I check whether a vertical scrollbar has appeared in a listview? I want to resize column widths if a vertical scrollbar appear.
    Use GetWindowLong and test for WS_VSCROLL.

    Quote Originally Posted by OldClock View Post
    2. Is it possible to allow a vertical scrollbar to appear when needed, but not a horizontal scrollbar?
    P.S. I am aware of ShowScrollBar, but when I use it to hide the horizontal scrollbar then visual artifacts appear in the bottom row where the scrollbar would have been, and the horizontal scrollbar appears anyway when I scroll vertically.
    In the article below is described how to avoid vertical scrollbar. (intercept WM_NCCALCSIZE)
    So for a horizontal it is likewise the same.

    https://stackoverflow.com/questions/...n-details-mode
    Last edited by Krool; May 19th, 2020 at 12:02 PM.

  12. #2812
    Addicted Member
    Join Date
    Jul 2016
    Posts
    230

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by OldClock View Post
    1. How can I check whether a vertical scrollbar has appeared in a listview?
    For reference, I used:

    Code:
    Public Enum ScrollBarStyles
        Horizontal_SBS = &H100000
        Vertical_SBS = &H200000
    End Enum
    
    Public Function isScrollbarVisible(ByVal hWnd As Long, ByVal sbs As ScrollBarStyles) As Boolean
        Dim wndStyle As Long
        wndStyle = GetWindowLong(hWnd, GWL_STYLE)
        isScrollbarVisible = (wndStyle And sbs) <> 0
    End Function
    
    ' Usage:
    If isScrollbarVisible(lv.hWnd, ScrollBarStyles.Horizontal_SBS) Then
        (...)

  13. #2813
    Member
    Join Date
    Aug 2016
    Posts
    50

    Re: CommonControls (Replacement of the MS common controls)

    Hello Krool,

    You could avoid using the "On Error Resume Next" and solve the error that appears on the line
    Code:
    If CLng (Button.Parent.ActiveControl.Default)> 0 Then Else Default = False
    Code:
    Private Sub DrawButton(ByVal hWnd As Long, ByVal hDC As Long, ByVal Button As Object)
    ...
    
    Select Case ButtonPart
        Case BP_PUSHBUTTON
            Default = Button.Default
            If GetFocus() <> hWnd Then
                On Error Resume Next
                If CLng(Button.Parent.ActiveControl.Default) > 0 Then Else Default = False
                On Error GoTo 0
            End If
    ...
    End Sub

  14. #2814

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by pepegriyo2016 View Post
    Hello Krool,

    You could avoid using the "On Error Resume Next" and solve the error that appears on the line
    Code:
    If CLng (Button.Parent.ActiveControl.Default)> 0 Then Else Default = False
    Code:
    Private Sub DrawButton(ByVal hWnd As Long, ByVal hDC As Long, ByVal Button As Object)
    ...
    
    Select Case ButtonPart
        Case BP_PUSHBUTTON
            Default = Button.Default
            If GetFocus() <> hWnd Then
                On Error Resume Next
                If CLng(Button.Parent.ActiveControl.Default) > 0 Then Else Default = False
                On Error GoTo 0
            End If
    ...
    End Sub
    I don't know what you mean..
    However, you are referring to the VisualStyles.bas to fix the graphical style for the VB.CommandButton.

    The CLng(Button.Parent.ActiveControl.Default) should never be > 0.
    It only forks to the true branch when an error happens. (in this case Default should remain True even if GetFocus() <> hWnd)
    So it is intended to have an OERN.
    Last edited by Krool; May 20th, 2020 at 04:51 PM.

  15. #2815
    Member
    Join Date
    Aug 2016
    Posts
    50

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    I don't know what you mean..
    However, you are referring to the VisualStyles.bas to fix the graphical style for the VB.CommandButton.

    The CLng(Button.Parent.ActiveControl.Default) should never be > 0.
    It only forks to the true branch when an error happens. (in this case Default should remain True even if GetFocus() <> hWnd)
    So it is intended to have an OERN.

    I have this error and it always stops there.

    Name:  2020-05-20 21_01_48-Window.jpg
Views: 1116
Size:  13.2 KB
    Name:  2020-05-20 21_01_24-Window.jpg
Views: 1142
Size:  26.5 KB

  16. #2816
    Member
    Join Date
    Aug 2016
    Posts
    50

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by pepegriyo2016 View Post
    I have this error and it always stops there.

    Name:  2020-05-20 21_01_48-Window.jpg
Views: 1116
Size:  13.2 KB
    Name:  2020-05-20 21_01_24-Window.jpg
Views: 1142
Size:  26.5 KB
    Krool,
    I found how to fix it. With Val ()

    'On Error Resume Next
    If CLng(Val(Button.Parent.ActiveControl.Default)) > 0 Then Else Default = False
    'On Error GoTo 0

  17. #2817

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by pepegriyo2016 View Post
    Krool,
    I found how to fix it. With Val ()

    'On Error Resume Next
    If CLng(Val(Button.Parent.ActiveControl.Default)) > 0 Then Else Default = False
    'On Error GoTo 0
    This "fixes" nothing, at least for me.

    I suggest the problem is that you have "Break on All Errors" selected in the IDE options.

  18. #2818
    Member
    Join Date
    Aug 2016
    Posts
    50

    Re: CommonControls (Replacement of the MS common controls)

    Krool,
    The Val() only fix the error 13 runtime, but I have another error is no fixed with Val()

  19. #2819

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Included the VirtualCombo control.

    It is actually a super-classed combo box control with a no-data list box portion. (LBS_NODATA)
    I called the class "VComboBoxWndClass".

    It would be a mess to include a "VirtualMode" property to the existing ComboBoxW. Therefore like the ImageCombo, FontCombo (and even VB.DriveListBox) are separate encapsulated combo box controls. (trimmed down to what actually is needed)

    Populating a VirtualCombo control is very quickly as just the .ListCount property must be set. (it can also be set at design-time)

    The VirtualCombo control retrieves the strings (when they need to be drawn) via the GetVirtualItem event.
    IncrementalSearch/FindVirtualItem event can also be handled to enable full functionality and behavior.

  20. #2820

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Behavior bugfix for the VirtualCombo control when Style is <> DropDownList.

    The ComboBox attempts to apply the top index for the drop-down list according to the text of the edit portion.
    For this case the LB_FINDSTRING is now handled and the related FindVirtualItem event must be handled for correct top index behavior by the ComboBox.

    Also added the DrawMode property, which can only be set to Normal (ownerdraw handled by VirtualCombo itself) or to OwnerDrawFixed where a ItemDraw event will be fired. (OwnerDrawVariable not possible due to LBS_NODATA restriction)

  21. #2821

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Since the VirtualCombo control is in a early stage I decided to change the event param in the 'IncrementalSearch' event.

    The old params were..
    Code:
    Event IncrementalSearch(ByVal KeyChar As Integer, ByVal StartIndex As Long, ByRef FoundIndex As Long)
    and the new one is simply..
    Code:
    Event IncrementalSearch(ByVal SearchString As String, ByVal StartIndex As Long, ByRef FoundIndex As Long)
    The difference in addition is also that the SearchString can "build-up" if typing multiple keys within a short interval. (short interval = system's double click time, multiplied with 2)

    So, using Len(SearchString) tells you the current "level" of incremental search.

    If classic search (like in a typical ListBox) is wanted with only 1 character search then simply just use Right$(SearchString, 1) within the IncrementalSearch event.

  22. #2822
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool,

    I'm having a problem getting VBCCR16.OCX working in my project. I get the following error dialog. VBCCR14.OCX seems to work. (Windows 10 Pro)

    I regsvr32.exe the VBCCR16.OCX as administrator in a console.

    VBCCR15 does the same as VBCCR16.

    Is this a Windows 10 issue running the IDE?
    Attached Images Attached Images  
    Last edited by ScriptBASIC; May 26th, 2020 at 08:55 PM.

  23. #2823
    Lively Member
    Join Date
    Oct 2016
    Posts
    108

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.

    Included the VirtualCombo control.

    It is actually a super-classed combo box control with a no-data list box portion. (LBS_NODATA)
    I called the class "VComboBoxWndClass".

    It would be a mess to include a "VirtualMode" property to the existing ComboBoxW. Therefore like the ImageCombo, FontCombo (and even VB.DriveListBox) are separate encapsulated combo box controls. (trimmed down to what actually is needed)

    Populating a VirtualCombo control is very quickly as just the .ListCount property must be set. (it can also be set at design-time)

    The VirtualCombo control retrieves the strings (when they need to be drawn) via the GetVirtualItem event.
    IncrementalSearch/FindVirtualItem event can also be handled to enable full functionality and behavior.

    Hi!
    I am a bit confused with this one.
    how is it used, and what is the advantage of it?

  24. #2824

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by ScriptBASIC View Post
    Hi Krool,

    I'm having a problem getting VBCCR16.OCX working in my project. I get the following error dialog. VBCCR14.OCX seems to work. (Windows 10 Pro)

    I regsvr32.exe the VBCCR16.OCX as administrator in a console.

    VBCCR15 does the same as VBCCR16.

    Is this a Windows 10 issue running the IDE?
    This is the clsid for the ListView. Can you search in regedit and tell what is there?

  25. #2825

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Semke View Post
    Hi!
    I am a bit confused with this one.
    how is it used, and what is the advantage of it?
    There is the common habit of transferring the data again and again.

    For example, you have a Recordset which queried a huge list.

    Normally, you would populate a ComboBox from that recordset into the ComboBox via .AddItem.
    So, in fact the data is in memory twice. (in the recordset and in the ComboBox)

    Using Virtual controls is not very known here. The advantage is that you only need to retrieve the data once, in our example in a recordset.
    The virtual control is only told how many records we have. So it is "populated" in light speed.

    Whenever the virtual control needs to draw the items in the current viewport it will raise a event. In that event you search the recordset for that specified index.

    So, the drawing tends to be slightly slower but that is marginal compared to the advantage of the light speed population.

  26. #2826
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: CommonControls (Replacement of the MS common controls)

    All the VBCCR controls pop this dialog with a different GUID.

  27. #2827

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by ScriptBASIC View Post
    All the VBCCR controls pop this dialog with a different GUID.
    When you search these guids in regedit, what do you find?

  28. #2828
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: CommonControls (Replacement of the MS common controls)

    Krool,

    I have VBCCR16 and the sidebysideand styles file as part of my project. I did a search of the registry using the listview GUID. FWIW VBCCR15 does the same as VBCCR16 with the dialog error.

    Update

    I unregistered all VBCCR## versions other than VBCCR16.OCX and it still is popping the error dialog. For some reason the VB6 component list is still showing VBCCR14 even though I unregistered all instances on the laptop.

    I then registered VBCCR14.OCX and was able to add VBCCR controls to the form again.
    Attached Images Attached Images  
    Last edited by ScriptBASIC; May 27th, 2020 at 07:16 PM.

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

    Question ListView Column Text 260 char display limitation?

    VBCCR 1.6.109

    I have a ListView with 2 columns (Report Mode).

    The 2. column contains text with more than 300 characters but only 260 characters will be displayed.

    Using .AutoSize (LvwColumnHeaderAutoSizeToItems Or LvwColumnHeaderAutoSizeToHeader) resizes the column to a max of 260 chars only.

    Manually setting of the column width makes the column widther but still only 260 characters are displayed at the column and the rest of the text is truncated...

    Can you remove the 260 char display restriction per column or is this a hardcoded limitation of the ListView?

  30. #2830
    Lively Member
    Join Date
    Oct 2016
    Posts
    108

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.

    Included the VirtualCombo control.
    Hi!,

    Is there any reason the VirtualCombo control is not included in the Compiled OCX Version (1.6.113).

  31. #2831

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    VBCCR 1.6.109

    I have a ListView with 2 columns (Report Mode).

    The 2. column contains text with more than 300 characters but only 260 characters will be displayed.

    Using .AutoSize (LvwColumnHeaderAutoSizeToItems Or LvwColumnHeaderAutoSizeToHeader) resizes the column to a max of 260 chars only.

    Manually setting of the column width makes the column widther but still only 260 characters are displayed at the column and the rest of the text is truncated...

    Can you remove the 260 char display restriction per column or is this a hardcoded limitation of the ListView?
    It's a hard limit by comctl32.dll. Only 260 will be displayed, but as the list view items are single-lined it is actually sufficient in most cases. (read-ability)

    Quote Originally Posted by Semke View Post
    Hi!,

    Is there any reason the VirtualCombo control is not included in the Compiled OCX Version (1.6.113).
    It will be included in OCX version 1.7
    Reason to not include in 1.6 is to maintain binary compatibility and keep the same clsid.

  32. #2832
    Hyperactive Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    416

    Re: CommonControls (Replacement of the MS common controls)

    I want a Label to auto-size its width to fit the length of the label text but I want its height to remain unchanged. The AutoSize property of the label control changes both height and width. Right now I'm hard-coding the height I want everywhere I set the label's caption but is there a more elegant way to do this? I'm open to subclassing this with some guidance.

    TIA

  33. #2833
    Hyperactive Member
    Join Date
    Aug 2011
    Location
    Palm Coast, FL
    Posts
    416

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by AAraya View Post
    I want a Label to auto-size its width to fit the length of the label text but I want its height to remain unchanged. The AutoSize property of the label control changes both height and width. Right now I'm hard-coding the height I want everywhere I set the label's caption but is there a more elegant way to do this? I'm open to subclassing this with some guidance.

    TIA
    According to documentation I've seen, the VB6 Label can do this using these settings:
    Code:
    AutoSize = True
    WordWrap = False
    LabelW does not behave the same way however.

    Use the AutoSize and WordWrap properties to determine how the Label displays lengthy text in its Caption. If you set the AutoSize property of the Label to True (default is False), the Label automatically shrinks or stretches to the exact size needed to display the text. The WordWrap property determines whether or not an autosized Label changes size in a horizontal direction (WordWrap = False, its default value) or in a vertical direction (WordWrap = True). Remember, WordWrap has an effect only if you first set AutoSize to True.
    Last edited by AAraya; Jun 8th, 2020 at 06:56 PM.

  34. #2834
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: CommonControls (Replacement of the MS common controls)

    > According to documentation I've seen, the VB6 Label can do this using these settings:

    IMO auto-sizing VB.Label *always* recalculates Height. This might remain unchanged if the new recalculated value is the same as the old value (i.e. rarely or when repeating previous auto-sizing).

    WordWrap controls if Width is fixed (not Height). When WordWrap is True then Width is not re-calculated. When WordWrap is False *both* Width and Height are re-calculated.

    cheers,
    </wqw>
    p.s. Consider when is this auto-sizing happening -- on Caption property assignment, on Font assignment, on WordWrap assigment and on AutoSize pulsing (set False and immediately to True) -- which is *very* confusing and just not very clever programming interface design for such functionality. (Bet this kludge happened progressively while adding features with each new VB version.)

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

    Text position is wrong when the font size is larger than 9px

    The position of the text of a checkbox or option button a little bit wrong when using a font size larger than 9px:
    Name:  text100%.png
Views: 857
Size:  5.6 KB
    Larger:
    Name:  text200%.jpg
Views: 922
Size:  17.1 KB

    I guess the text position should be 1 pixel up if the font size is larger than 9px
    or you have to auto center the text by checking the text height and the checkbox/option height to make this water proof for all font sizes.

  36. #2836
    New Member
    Join Date
    Jun 2020
    Location
    UA
    Posts
    13

    Re: CommonControls (Replacement of the MS common controls)

    deleted
    Last edited by tnrprog; Jun 11th, 2020 at 03:35 AM.

  37. #2837
    New Member
    Join Date
    Jun 2020
    Location
    UA
    Posts
    13

    Re: CommonControls (Replacement of the MS common controls)



    Listview smallicons glitch when screen DPI>96

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

    Re: CommonControls (Replacement of the MS common controls)

    Whats the problem with the icons? i dont get it...
    You should post a second picture and show how they look without the "glitch".

  39. #2839
    New Member
    Join Date
    Jun 2020
    Location
    UA
    Posts
    13

    Re: CommonControls (Replacement of the MS common controls)

    DPI=96 (screen size 100%). Icons are OK:


    DPI=120 (screen size 125%). Icons are OK if themed, but bugged if classic:


    DPI=192 (screen size 200% - I use it for 4K display). Icons have bug. And here it is obvious that the Imagelist returns part of the next ListImage. Although it should not. The MS version does not.

  40. #2840

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by tnrprog View Post
    DPI=96 (screen size 100%). Icons are OK:


    DPI=120 (screen size 125%). Icons are OK if themed, but bugged if classic:


    DPI=192 (screen size 200% - I use it for 4K display). Icons have bug. And here it is obvious that the Imagelist returns part of the next ListImage. Although it should not. The MS version does not.
    I bet that on MS ListView V5 you have the same..

    The MS ListView V6 is a zombie state version of an ancient comctl32.dll.

    If you would like this to be fixed then good luck opening a MS ticket.

Page 71 of 94 FirstFirst ... 21616869707172737481 ... 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