CommonControls (Replacement of the MS common controls) - Page 46-VBForums
Page 46 of 46 FirstFirst ... 3643444546
Results 1,801 to 1,827 of 1827

Thread: CommonControls (Replacement of the MS common controls)

  1. #1801
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    256

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.
    The performance of the ToolBar has been increased.
    This was achieved by internally doing at some points (if applicable) a invalidation instead of a refresh.
    Very good, works well, thanks.

    Changing .TextAlignment will cause re-creating of the control. During the re-creation LockWindowUpdate is used:
    Maybe LockWindowUpdate does cause a screen flicker in your particular app, just a guess.
    It does.
    I don't use LockWindowUpdate in the app, which could be the cause.
    Also I don't know of other controls that do, at least I can't find because they are compiled (CC5).

    Refer to http://www.vbforums.com/showthread.p...=1#post5108773 for reason and explanation.
    Understood.
    This improvement will work for sure if VBCCR is alone in the world.

    Solution could be to set the .TextAlignment already at design-time to the wanted value.
    This solution works very ok.
    Changing .TextAlignment is very unlikely.
    Flickering is solved so far.

  2. #1802

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    830

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    Understood.
    This improvement will work for sure if VBCCR is alone in the world.
    Also see http://fgaillard.com/2011/02/the-unf...-wm_setredraw/

    I won't switch back to WM_SETREDRAW.

  3. #1803
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    256

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Very informative.
    The desktop flicker occurs when the handle is 0, right?

    My initial problem is solved anyway.
    But it is interesting why the flicker comes up in your Recreate.

    I won't switch back to WM_SETREDRAW.
    Why should you?

  4. #1804
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    256

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The performance of the ToolBar has been increased.
    This was achieved by internally doing at some points (if applicable) a invalidation instead of a refresh.
    I forgot to report the advantage.
    Before: 250 msec. and more
    Now: 16 msec., and less

  5. #1805
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Question No unicode support at the list view event "OLEDragDrop"

    VBCCR14.OCX v1.4.0.50
    Control: ListView in Report mode

    hi krool,

    i drag and dropped a folder with unicode characters in the name from the windows explorer on the list view in report mode but the event "OLEDragDrop" just returns the folder path in ANSI and the unicode characters are replaced with char "?".

    Is this something you can fix?
    Last edited by Mith; Oct 2nd, 2017 at 05:38 AM.

  6. #1806
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Question List View "Right To Left" not work

    VBCCR14.OCX v1.4.0.50
    Control: ListView in Report mode

    Hi Krool,

    i use the following code with a list view in report mode but the content of the list view doesnt get mirrored as expected:

    lvwFF.RightToLeft = True
    lvwFF.RightToLeftLayout = True

    i tried that code with win7x64 and the display language arabic.

    Any ideas why this is not working?

    Name:  Screenshot - 02.10.2017 , 17_45_57.jpg
Views: 323
Size:  5.7 KB

  7. #1807

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    830

    Re: List View "Right To Left" not work

    Quote Originally Posted by Mith View Post
    VBCCR14.OCX v1.4.0.50
    Control: ListView in Report mode

    Hi Krool,

    i use the following code with a list view in report mode but the content of the list view doesnt get mirrored as expected:

    lvwFF.RightToLeft = True
    lvwFF.RightToLeftLayout = True

    i tried that code with win7x64 and the display language arabic.

    Any ideas why this is not working?

    Name:  Screenshot - 02.10.2017 , 17_45_57.jpg
Views: 323
Size:  5.7 KB
    How is .RightToLeftMode set?

  8. #1808
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Re: List View "Right To Left" not work

    How is .RightToLeftMode set?
    .RightToLeftMode = CCRightToLeftModeVBAME

    i didnt set/changed this option. its the standard value.

    ok, i could solve the problem after changing the value to:

    .RightToLeftMode =CCRightToLeftModeNoControl

    Name:  Screenshot - 02.10.2017 , 21_39_51.jpg
Views: 322
Size:  4.9 KB

    thx for the hint!
    Last edited by Mith; Oct 2nd, 2017 at 09:40 AM.

  9. #1809

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    830

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    This time the CoolBar control got my attention to make the control better.

    First bugfix is that changing the VerticalGripper property on a vertical orientation CoolBar control was cumbersome.
    The solution was to reset all header size dimensions to -1, thus the control has to recalculate them.

    Second bugfix was that the HideCaption property of a Band was never written to the property bag.. easy fix to include in WriteProperties.

    The actual improvement (make the control better) is as following:

    The ForeColor of a Band (whether derived via 'UseCoolBarColors' or directly) was not supported when visual styles are applied.
    However, that improvement works only on Vista+ (minimum comctl32.dll 6.1) since DrawThemeTextEx is not supported in Windows XP.

    Name:  CoolBarThemedTextColor.png
Views: 306
Size:  1.3 KB

    But there is another glitch that is fixed also for Windows XP. (MS never fixed this since Windows XP)
    However, that glitch does not appear when visual styles are not applied.

    The glitch can be replicated in following scenario:
    Orientation = 1 - Vertical
    VerticalGripper = True
    3 Bands with initial settings except MinHeight of 1st Band set to 800 and input Caption text of "asd asd yxcyxc".
    Then at run-time drag the band from left to right.

    Before:
    Name:  CoolBarGlitchBeforeFix.png
Views: 309
Size:  2.2 KB

    After:
    Name:  CoolBarGlitchAfterFix.png
Views: 305
Size:  2.3 KB

    As can be seen the text "asd asd yxcyxc" is measured by MS always on top-left and not the actual band coordinates.

    These enhancements can be switched off by the conditional compilation constant 'ImplementThemedReBarFix'.
    Last edited by Krool; Oct 4th, 2017 at 01:31 AM.

  10. #1810
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Re: No unicode support at the list view event "OLEDragDrop"

    Quote Originally Posted by Mith View Post
    VBCCR14.OCX v1.4.0.50
    Control: ListView in Report mode

    hi krool,

    i drag and dropped a folder with unicode characters in the name from the windows explorer on the list view in report mode but the event "OLEDragDrop" just returns the folder path in ANSI and the unicode characters are replaced with char "?".

    Is this something you can fix?
    i used this code:

    Code:
    Private Sub lvwTest_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, y As Single)
    
    Dim I As Long
    
    If data.GetFormat(vbCFFiles) Then
    
       For I = 1 To data.Files.Count
                
          ' data.Files.Item(I) is ANSI and contains no unicode characters
          
       Next I
    
    End If
    
    End Sub

  11. #1811

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    830

    Re: No unicode support at the list view event "OLEDragDrop"

    Quote Originally Posted by Mith View Post
    i used this code:

    Code:
    Private Sub lvwTest_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, y As Single)
    
    Dim I As Long
    
    If data.GetFormat(vbCFFiles) Then
    
       For I = 1 To data.Files.Count
                
          ' data.Files.Item(I) is ANSI and contains no unicode characters
          
       Next I
    
    End If
    
    End Sub
    http://cyberactivex.com/UnicodeTutor...gDrop_or_Paste

  12. #1812
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Re: No unicode support at the list view event "OLEDragDrop"

    How about we implement this inside VBCCR14.OCX to support unicode at the OLEDragDrop-event for all controls?

  13. #1813
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    256

    Re: CommonControls (Replacement of the MS common controls)

    SUBCLASSING ADVICE

    Up to now I use SSUBTMR6.DLL for subclassing.
    From now on, I want to use the same technique that Krool uses in his controls.

    I'm stuck.
    Implements ISubclass creates the ISubclass_Message function, and I could do what I want from there.
    But I don't know how to bring messages into the game.
    In SSUBTMR6.DLL I simply had to attach/detach messages, which I could process in ISubclass_WindowProc.

    How does it work with Krool's subclassing?
    A very basic example would help me out.

    Thank you.

    Edit:
    I try this in the main form of the example (post #1).

  14. #1814
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,498

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    SUBCLASSING ADVICE

    Up to now I use SSUBTMR6.DLL for subclassing.
    From now on, I want to use the same technique that Krool uses in his controls.

    I'm stuck.
    Implements ISubclass creates the ISubclass_Message function, and I could do what I want from there.
    But I don't know how to bring messages into the game.
    In SSUBTMR6.DLL I simply had to attach/detach messages, which I could process in ISubclass_WindowProc.

    How does it work with Krool's subclassing?
    A very basic example would help me out.

    Thank you.

    Edit:
    I try this in the main form of the example (post #1).
    Krool's method (common controls subclassing) does not filter messages. unless intercepted, you get them all.

    also you gotta make sure you forward to ComCtlsDefaultProc (DefSubclassProc) in your ISubclass_Message
    Code:
    Option Explicit
    
    Implements ISubclass
    
    Private Sub Form_Load()
        ComCtlsSetSubclass hWnd, Me, 0
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        ComCtlsRemoveSubclass hWnd
    End Sub
    
    Private Function ISubclass_Message(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As Long) As Long
        Select Case wMsg
            Case WM_DESTROY
        End Select
        ISubclass_Message = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)
    End Function
    Last edited by DEXWERX; Oct 5th, 2017 at 12:38 PM.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE

  15. #1815
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    256

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by DEXWERX View Post
    Krool's method (common controls subclassing) does not filter messages. unless intercepted, you get them all.

    also you gotta make sure you forward to ComCtlsDefaultProc (DefSubclassProc) in your ISubclass_Message
    Code:
    Option Explicit
    
    Implements ISubclass
    
    Private Sub Form_Load()
        ComCtlsSetSubclass hWnd, Me, 0
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        ComCtlsRemoveSubclass hWnd
    End Sub
    
    Private Function ISubclass_Message(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long, ByVal dwRefData As Long) As Long
        Select Case wMsg
            Case WM_DESTROY
        End Select
        ISubclass_Message = ComCtlsDefaultProc(hWnd, wMsg, wParam, lParam)
    End Function
    Thank you DEXWERX.
    That was very helpful.

  16. #1816
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    256

    Re: CommonControls (Replacement of the MS common controls)

    PAGER PROBLEMS

    See attached project.
    Pager.zip

    There are 3 Pagers.

    Pager1 (red) is vertical.
    Buddycontrol is Picture1, set at design time.

    Pager2 (blue) is horizontal.
    Buddycontrol is Picture2, set at design time.

    Pager3 (lila) is horizontal.
    Buddycontrol is Toolbar1, set at design time.

    a)
    When I start, only Pager3 catches the Buddy correct.
    To assign the Buddies in Form:Load doesn't help.
    When the Form is loaded, the CommandButton works to do it.

    b)
    Now let's resize the form manually.
    Watch the Pager Buttons.
    The Pager shows it's Button wrong.
    It doesn't refer to the contained window size.
    Also when we resize back and forth, this Button shows up at different window sizes.


    ---

    With a toolbar as the contained window, it works ok.

    Do I do something wrong, or is a PictureBox not suitable for a Pager?

    Thanks
    Karl

  17. #1817
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Question How to center the icons at the column header & the subitems?

    VBCCR14.OCX v1.4.0.56
    Control: ListView in Report mode

    Does anyone know how to center the icons at the column header and the subitems?

    Name:  Screenshot - 07.10.2017 , 09_21_18.png
Views: 229
Size:  5.5 KB

  18. #1818
    Addicted Member
    Join Date
    Feb 2014
    Posts
    202

    Re: CommonControls (Replacement of the MS common controls)

    Code:
        ListView1.ColumnHeaders.Add , , "Name", 2000, LvwColumnHeaderAlignmentLeft
        ListView1.ColumnHeaders.Add , , "Symbol", 1200, LvwColumnHeaderAlignmentCenter
        ListView1.ColumnHeaders.Add , , "Anything", 1200, LvwColumnHeaderAlignmentRight
    or

    Code:
        ListView1.ColumnHeaders(2).Alignment = LvwColumnHeaderAlignmentCenter

  19. #1819
    New Member
    Join Date
    Dec 2015
    Posts
    2

    Re: CommonControls (Replacement of the MS common controls)

    is there a tool ,can be used to upgrade or migrate VB common Controls sp6 to CCRP v 1.4 ???
    had any one ade or used a tool like this , speciall for ToolBar and ImageList ... ??
    if yes please guide me or provie me a link to such tool

  20. #1820

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    830

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    PAGER PROBLEMS

    There are 3 Pagers.

    Pager1 (red) is vertical.
    Buddycontrol is Picture1, set at design time.

    Pager2 (blue) is horizontal.
    Buddycontrol is Picture2, set at design time.

    Pager3 (lila) is horizontal.
    Buddycontrol is Toolbar1, set at design time.

    a)
    When I start, only Pager3 catches the Buddy correct.
    To assign the Buddies in Form:Load doesn't help.
    When the Form is loaded, the CommandButton works to do it.

    b)
    Now let's resize the form manually.
    Watch the Pager Buttons.
    The Pager shows it's Button wrong.
    It doesn't refer to the contained window size.
    Also when we resize back and forth, this Button shows up at different window sizes.


    ---

    With a toolbar as the contained window, it works ok.

    Do I do something wrong, or is a PictureBox not suitable for a Pager?
    There is indeed a specialty with the PictureBox control.
    It seems that the PictureBox will be re-sized by the Pager control. Also the issue with not able to set at design-time or at Form_Load is strange.
    For example setting a FrameW control (pure VB.UserControl only) works without issues.

    However, with following workaround you get the PictureBox behavior also correct:

    Code:
    Private Sub Form_Load()
    ' Preserve dimensions as the PictureBox will be re-sized by Pager control due to unknown reasons..
    H1 = Picture1.Height + (Pager1.BorderWidth * 2)
    W1 = Picture2.Width + (Pager2.BorderWidth * 2)
    
    End Sub
    Don't let the Pager control calculate the sizes automatically, adjust to preserved dimensions accordingly.
    Code:
    Private Sub Pager1_CalcSize(Width As Single, Height As Single)
    Height = H1
    End Sub
    
    Private Sub Pager2_CalcSize(Width As Single, Height As Single)
    Width = W1
    End Sub

  21. #1821
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    256

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    There is indeed a specialty with the PictureBox control.
    It seems that the PictureBox will be re-sized by the Pager control. Also the issue with not able to set at design-time or at Form_Load is strange.
    For example setting a FrameW control (pure VB.UserControl only) works without issues.
    I wondered why my PictureBox size changes magically as well.
    Of course I investigated my code first...

    Ok, this workaround will work.
    In my case the PictureBox size is quite dynamic, and I need to set and get the size often.
    This workaround is too cumbersome for me.

    I will use FrameW with BorderStyle = 0.
    (Just found out that 0 doesn't draw frame and caption).

    Solved so far, thank you.
    Last edited by Karl77; Oct 9th, 2017 at 09:18 AM.

  22. #1822
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Question Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by chosk View Post
    Code:
        ListView1.ColumnHeaders.Add , , "Name", 2000, LvwColumnHeaderAlignmentLeft
        ListView1.ColumnHeaders.Add , , "Symbol", 1200, LvwColumnHeaderAlignmentCenter
        ListView1.ColumnHeaders.Add , , "Anything", 1200, LvwColumnHeaderAlignmentRight
    or

    Code:
        ListView1.ColumnHeaders(2).Alignment = LvwColumnHeaderAlignmentCenter
    I tried this code but is doesnt center the icons at the columnheader and the subitem.

    Columnheader:

    Adding one space char at the text property of the columnheader fixed the problem and the columnheader icon gets centered with the text (" ").

    Subitem:

    I also added a space char to the text property of the subitem but the icon of the subitems is still left-aligned...

    Name:  Screenshot - 09.10.2017 , 16_48_14.png
Views: 171
Size:  3.8 KB

    Maybe krool can check if this is a bug inside his code or a MS-related problem...
    Last edited by Mith; Oct 9th, 2017 at 04:53 AM. Reason: attached pic was not showed at the msg

  23. #1823
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Question RichTextBox font display problem

    hi krool,

    i loaded two different files with unicode text into the RichTextBox and the font always was changed automatically at a specific line.

    Here at the 3. line:

    Name:  Screenshot - 11.10.2017 , 07_25_53.png
Views: 148
Size:  5.2 KB
    Download: folders2.txt

    and here at the 7. line:

    Name:  Screenshot - 11.10.2017 , 07_25_34.png
Views: 148
Size:  4.6 KB
    Download: log 2.txt

    Code:
    rtfTest.LoadFile sFile$, RtfLoadSaveFormatUnicodeText
    After loading the unicode files i had set the font again but it doesnt changed the font display at the RichTextBox...any hints whats going here?

  24. #1824
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,498

    Re: CommonControls (Replacement of the MS common controls)

    the control automatically jumps to font substitution as soon as you get to a character not available in the original font.
    try using a font that has those characters already.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE

  25. #1825
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,085

    Re: CommonControls (Replacement of the MS common controls)

    ListBoxW etc. is lack of DataMember, DataSource, DataFeild,DataFormat properties... Can you implement those like VBFlexGrid?

  26. #1826
    Junior Member
    Join Date
    Jul 2017
    Posts
    22

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by DEXWERX View Post
    the control automatically jumps to font substitution as soon as you get to a character not available in the original font.
    try using a font that has those characters already.
    Thank you very much for that hint!

    Setting the font of the RichTextBox to "Arial Unicode MS" fixed the problem!

  27. #1827

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2012
    Posts
    830

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    Certain tweaks done in order to run better in the VBA environment.
    In theory those tweaks only would effect the OCX version. However, to be in sync the Std-EXE version got tweaked as well.
    There is no actual difference for VB6 IDE. It works like before.

    But for new VBCCR14.OCX (rev 61 onwards) and for future VBCCR15.OCX the support for the VBA IDE is better.
    Certainly newer Office version (e.g. 2010) is not so "sensitive" as older Office version (e.g. XP, 2002) for crashes.
    However, all tests are done in Office 2002 to be reliable.

    Also the "Cannot call friend function on object which is not an instance of defining class" error for the class collection objects is fixed. (VBA only)

    In order to replace to new version of the OCX it is strongly recommended to delete certain cache files for MS Office:

    Code:
    C:\Users\<username>\AppData\Local\Temp\VBE\VBCCR14.exd
    Code:
    C:\Users\<username>\Application Data\Microsoft\Forms\VBCCR14.exd
    Those cache files do only exist when previously loaded VBCCR14 into the toolbox on a UserForm.

    Then replace the new VBCCR14.OCX in the system directory.

Page 46 of 46 FirstFirst ... 3643444546

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.