Page 99 of 99 FirstFirst ... 498996979899
Results 3,921 to 3,955 of 3955

Thread: CommonControls (Replacement of the MS common controls)

  1. #3921
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,420

    Re: CommonControls (Replacement of the MS common controls)


  2. #3922

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,547

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Arnoutdv View Post
    You can alternatively use the OLEObjectsAddFromPicture method which doesn't mess with the clipboard.

  3. #3923
    New Member
    Join Date
    Jan 2025
    Posts
    6

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Arnoutdv View Post
    i don't see a reply button only reply with quotes. so here goes... i'm using twinbasic. when i copy in your code, a yellow line appears under this command: Clipboard.SetData Picture. the message i get is this: [setdata] has not yet been imlemented.

  4. #3924
    New Member
    Join Date
    Jan 2025
    Posts
    6

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    You can alternatively use the OLEObjectsAddFromPicture method which doesn't mess with the clipboard.
    i think i have it. in twinbasic the setdata command is not ready, but i'm using the program called greenshot to capture the screen i want and placing it into the clipboard. from there in the twinbasic program i have a button which when pressed takes whatever is in the clipboard (the greenshot capture), and places it into the rich text control. this seems to be working. i need to test more. once i have the text and pic in the richtextbox is there a way to save the contains of the richtextbox to a file ? a file type that perhaps the richtextbox can load from on the form load event >

  5. #3925
    New Member
    Join Date
    Jan 2025
    Posts
    6

    Re: CommonControls (Replacement of the MS common controls)


  6. #3926
    New Member
    Join Date
    Jan 2025
    Posts
    6

    Re: CommonControls (Replacement of the MS common controls)

    i got it. RTB.SaveFile("c:\dbaseform\mynote.rtf"). rtf format is default. i believe i have all the pieces i need. thanks to all.

  7. #3927
    Member
    Join Date
    Jun 2021
    Location
    Germany
    Posts
    37

    Re: CommonControls (Replacement of the MS common controls)

    Hello Krool,

    With the toolbar: When I hold the Shift and blick a button, then Tb ButtonClick event doesn't fire.

    What am I doing wrong?

    Thanks!

  8. #3928
    New Member
    Join Date
    Jan 2025
    Posts
    6

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by clintc View Post
    Hello Krool,

    With the toolbar: When I hold the Shift and blick a button, then Tb ButtonClick event doesn't fire.

    What am I doing wrong?

    Thanks!
    not directed toward me but i believe i can answer this question. the shift + left mouse click together is a different event than just left mouse button.
    for the left mouse button click you can just use the on click event. but for the shift + left mouse button click you are going to have to use the mouse down event. something like this:

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then
    If Shift And acShiftMask Then
    ' Shift key was pressed during the left mouse click
    ' Add your code here to handle this event
    Else
    ' Regular left mouse click
    ' Add your code here to handle this event
    End If
    End If
    End Sub

  9. #3929
    Member
    Join Date
    Jun 2021
    Location
    Germany
    Posts
    37

    Re: CommonControls (Replacement of the MS common controls)

    No, not that.

    Hallo Krool,

    I found out the cause:

    After I turned off "AllowCustomize" it works as I need!

    I capture the Shift-Click in the TB Click-event - as I did with the Common Controls ocx version - in order to offer a second option to the click-event.

    Thank you for your time!

  10. #3930
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,644

    Re: CommonControls (Replacement of the MS common controls)

    Hi Krool,

    I'm rewriting your TreeView control with RC6. One of the problems I've found is that when the TreeView control is loaded with hundreds of thousands of nodes, it takes a long time to release the control. While this is an old problem inherent in VB6-Apps, if the TreeView control doesn't solve this problem, then its use cases will be somewhat limited. MS-TreeView does not have this problem.

    It's recommended to rewrite the class TvwNode with Olaf's LightWeight-COM technology to solve this problem completely.

    Here's the test code:

    Form1
    Code:
    Option Explicit
    
    Private Declare Function GetTickCount Lib "kernel32" () As Long
    
    Private Sub Command1_Click()
    Dim i As Long, j As Long, k As Long, l As Long, m As Long, L1Nodes As Long, L2Nodes As Long, L3Nodes As Long, L4Nodes As Long
    Dim lTotal As Long, t As Long
    Dim oNode1 As TvwNode, oNode2 As TvwNode, oNode3 As TvwNode, oNode4 As TvwNode
    
        'HScroll1AnimationSpeed.Value = 12
        
        L1Nodes = 10: L2Nodes = 8: L3Nodes = 14: L4Nodes = 7
        'L1Nodes = 20: L2Nodes = 16: L3Nodes = 28: L4Nodes = 14
        'If chkLargeData.Value = 1 Then
            L1Nodes = 30: L2Nodes = 24: L3Nodes = 42: L4Nodes = 21
        'End If
        
        lTotal = (L1Nodes * L2Nodes * L3Nodes * L4Nodes) + (L1Nodes * L2Nodes * L3Nodes) + (L1Nodes * L2Nodes) + L1Nodes
        
        Randomize
        
        TreeView1.Nodes.Clear
        
        t = GetTickCount
        TreeView1.Visible = False
        
        With TreeView1.Nodes
            For i = 1 To L1Nodes
                m = m + 1
                Set oNode1 = .Add(, , "1:" & i, RandomCaption & "Staff Member" & m)        ' ,   "Staff Member"
                For j = 1 To L2Nodes
                    m = m + 1
                    Set oNode2 = .Add(oNode1, TvwNodeRelationshipChild, "1:" & i & "-2" & j, RandomCaption & "Folder " & m)            ' , "Folder"
                    For k = 1 To L3Nodes
                        m = m + 1
                        Set oNode3 = .Add(oNode2, TvwNodeRelationshipChild, "1:" & i & "-2" & j & "-3" & k, RandomCaption & "Event " & m)       ' , "Event"
                        For l = 1 To L4Nodes
                            m = m + 1
                            If Rnd < 0.8 Then
                               Set oNode4 = .Add(oNode3, TvwNodeRelationshipChild, "1:" & i & "-2" & j & "-3" & k & "-4" & l, RandomCaption & "Appointment " & m)       ' , "Appointment"
                            Else
                               Set oNode4 = .Add(oNode3, TvwNodeRelationshipChild, "1:" & i & "-2" & j & "-3" & k & "-4" & l, RandomCaption & "Event Note " & m)        ' , "Note"
                            End If
                        Next l
                    Next k
                Next j
            Next i
            .Add , , "Cog", "Settings" ', "COG"            ' , "Cog"
            .Add , , "Search", "Searches" ', "SEARCH"          ' , "Search"
        End With
        
        MsgBox TreeView1.Nodes.Count + 10 & " sorted nodes added in " & (GetTickCount - t) / 1000 & " seconds"
        
        'New_c.Timing True
        t = GetTickCount
            TreeView1.Visible = True
            TreeView1.ZOrder 0
        MsgBox "Show TreeView1: " & (GetTickCount - t) / 1000 & " seconds"
        
        Command1.Enabled = False
        
    End Sub
    
    Private Sub Form_Load()
        'InitResources
        'InitResources2
    End Sub
    
    Private Function RandomCaption() As String
    Dim s(1 To 7) As String
        
        s(1) = "Alpha ": s(2) = "Bravo ": s(3) = "Charlie ": s(4) = "Delta ": s(5) = "Echo ": s(6) = "Foxtrot ": s(7) = "Golf "
        RandomCaption = s(Int(Rnd * 7) + 1)
    
    End Function

  11. #3931
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,663

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by SearchingDataOnly View Post
    It's recommended to rewrite the class TvwNode with Olaf's LightWeight-COM technology to solve this problem completely.
    Might be worth trying the twinBasic VBCCR package to test its performance, it shouldn't exhibiting VB6's pathological destruction behaviour.

    For example, here's an object destruction comparison with VB RC6 and a tB compiled version:

    RC6

    Name:  rc6destroy.jpg
Views: 1120
Size:  37.9 KB

    tB RC5

    Name:  tbRcdestroy.jpg
Views: 1111
Size:  38.3 KB

    ~2x instantiate improvement and ~1000x destruction improvement.

  12. #3932
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,420

    Re: CommonControls (Replacement of the MS common controls)

    tbRichClient5? That’s interesting!

  13. #3933
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,663

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Arnoutdv View Post
    tbRichClient5? That’s interesting!
    Yeah! tB is now capable of compiling (an admittedly very old version of) RC5, so I suspect it should be possible to compile RC6 too. In theory a port to 64-bit should also be doable, albeit with a lot of work for anything using APIs, pointers, etc...still, it's significant progress and quite exciting.

  14. #3934
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,663

    Re: CommonControls (Replacement of the MS common controls)

    Anyway this is getting off topic, so we best move on (sorry Krool!)

  15. #3935

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,547

    Re: CommonControls (Replacement of the MS common controls)

    About fast creation / destruction.
    Let's hope that soon a tB compilation for VB6 can solve that issue.

  16. #3936
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    533

    Re: CommonControls (Replacement of the MS common controls)

    LISTBOXW question

    See sample project:
    2025-02-12_ListBox.zip

    When a ListBoxW loses focus, it flickers.
    Up to now I couldn't find a way around this.

    Can you help?

  17. #3937
    Member
    Join Date
    Jun 2021
    Location
    Germany
    Posts
    37

    Re: CommonControls (Replacement of the MS common controls)

    Works fine for me.

    Of course, setting a focus on a MouseMove will cause flickering of the edit box.
    This can be prevented by setting the focus only if the edit box is the me.ActiveControl.
    Last edited by clintc; Feb 12th, 2025 at 09:45 AM.

  18. #3938
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    533

    Re: CommonControls (Replacement of the MS common controls)

    It's about the flashing ListboxW on losing focus. Setfocus on MouseMove is for demo only.

  19. #3939
    Member
    Join Date
    Jun 2021
    Location
    Germany
    Posts
    37

    Re: CommonControls (Replacement of the MS common controls)

    I don't see it flashing.

  20. #3940
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,644

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by jpbro View Post
    Might be worth trying the twinBasic VBCCR package to test its performance, it shouldn't exhibiting VB6's pathological destruction behaviour.

    For example, here's an object destruction comparison with VB RC6 and a tB compiled version:

    RC6

    Name:  rc6destroy.jpg
Views: 1120
Size:  37.9 KB

    tB RC5

    Name:  tbRcdestroy.jpg
Views: 1111
Size:  38.3 KB

    ~2x instantiate improvement and ~1000x destruction improvement.
    Sorry for the late reply, I haven't been online these days.

    The performance of the tB compiler is amazing, but I decided to solve this problem in VB6 anyway.

    I have to say that tB is really exciting.

  21. #3941
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    533

    Re: CommonControls (Replacement of the MS common controls)

    (LISTBOXW problem)

    I don't see it flashing.
    You are right.
    There is no flashing when Visual Styles are not in use.
    This project uses Visual Styles (you need to compile the project to see the effect):
    2025-02-12_ListBox_B.zip

    About the MouseMove over a Textbox and Setfocus:
    In the main app, there are some controls which steal the focus on a MouseMove.
    These controls are not VB or VBCCR controls.
    I'm not sure if I can change their behavior.

    @Krool:
    I tried the same in tB 670.
    No flicker in the ListBox!
    Some (expected) flicker in the TextBox, that's another story, and of no interest here.
    Unfortunately the *.twinproj is too large to upload here, 6MB uncompressed, 1.5MB ZIP.
    I wonder why it is that big.
    When I import Project10.vbp into tB the size is about 10 KB.
    Project10.zip

  22. #3942
    Hyperactive Member Mith's Avatar
    Join Date
    Jul 2017
    Location
    Thailand
    Posts
    460

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    About fast creation / destruction.
    Let's hope that soon a tB compilation for VB6 can solve that issue.
    Do you work on a tB compilation of the VBCCR.OCX that can be used with VB6?

  23. #3943

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,547

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Mith View Post
    Do you work on a tB compilation of the VBCCR.OCX that can be used with VB6?
    tB does not yet allow to link Property pages to UserControl. But yes, when tB reaches stable V1 then why not making a VBCCR20.OCX ? (where the 32-bit version can be used in VB6)

  24. #3944
    Member
    Join Date
    Jun 2021
    Location
    Germany
    Posts
    37

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    (LISTBOXW problem)


    You are right.
    There is no flashing when Visual Styles are not in use.
    This project uses Visual Styles (you need to compile the project to see the effect):
    2025-02-12_ListBox_B.zip

    About the MouseMove over a Textbox and Setfocus:
    In the main app, there are some controls which steal the focus on a MouseMove.
    These controls are not VB or VBCCR controls.
    I'm not sure if I can change their behavior.

    @Krool:
    I tried the same in tB 670.
    No flicker in the ListBox!
    Some (expected) flicker in the TextBox, that's another story, and of no interest here.
    Unfortunately the *.twinproj is too large to upload here, 6MB uncompressed, 1.5MB ZIP.
    I wonder why it is that big.
    When I import Project10.vbp into tB the size is about 10 KB.
    Project10.zip
    I still see no difference.

  25. #3945
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    533

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by clintc View Post
    I still see no difference.
    Attachment 194196

    Download and remove the zip extension.
    Last edited by Karl77; Feb 13th, 2025 at 03:42 AM.

  26. #3946
    Member
    Join Date
    Jun 2021
    Location
    Germany
    Posts
    37

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    Attachment 194196

    Download and remove the zip extension.
    There is no attachment there.

  27. #3947
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    533

    Re: CommonControls (Replacement of the MS common controls)


  28. #3948
    Member
    Join Date
    Jun 2021
    Location
    Germany
    Posts
    37

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    Yes, that is indeed strange.

    But sorry, I do not see that flicker with the project on my system.

  29. #3949
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    533

    Re: CommonControls (Replacement of the MS common controls)

    I have a kind of 'solution'.
    In the ListBoxW source, I added a DoEvents on WM_KILLFOCUS:

    Code:
    Private Function WindowProcControl(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Select Case wMsg
        Case WM_SETFOCUS
            If wParam <> UserControl.hWnd Then SetFocusAPI UserControl.hWnd: Exit Function
            Call ActivateIPAO(Me)
        Case WM_KILLFOCUS
            Debug.Print "WM_KILLFOCUS"
            DoEvents
            Call DeActivateIPAO
        Case ...
    This fixes the flickering completely.
    I'm not sure yet if there are side effects from this addition.

    Later:
    I don't feel fine with the DoEvents.
    So I tried this:

    Code:
        Case WM_KILLFOCUS
            Debug.Print "WM_KILLFOCUS"
            Call DeActivateIPAO
            Exit Function
    Exit Function cures the flicker as well.
    Last edited by Karl77; Feb 13th, 2025 at 06:06 AM.

  30. #3950
    Junior Member
    Join Date
    Aug 2022
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    First time trying any of Krool's controls, using the latest OCX, I see at most four events max for any control, Gotfocus, Lostfocus, Dragover, Dragdrop. Guess I'll have to finally try a bootleg VB6 or nothing. I have several of these I downloaded years ago but was always too much of a scaredy cat install them.

  31. #3951
    Hyperactive Member
    Join Date
    Jul 2022
    Location
    Buford, Ga USA
    Posts
    488

    Re: CommonControls (Replacement of the MS common controls)

    If you could give more information, do you have VB6 SP6? What OS are you using? What are the steps you took in your attempt to use it?

    EDIT: Screenshot https://imgur.com/a/6Q1zIdI
    I simply downloaded VBCCR18.OCX.rar, unzipped the OCX into a project folder. Added it to the toolbox and am able to use the controls as described. (I just added one to test in the screenshot)
    Last edited by jdelano; Feb 20th, 2025 at 09:13 AM.

  32. #3952
    Junior Member
    Join Date
    Aug 2022
    Posts
    19

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by jdelano View Post
    If you could give more information, do you have VB6 SP6? What OS are you using? What are the steps you took in your attempt to use it?

    EDIT: Screenshot https://imgur.com/a/6Q1zIdI
    I simply downloaded VBCCR18.OCX.rar, unzipped the OCX into a project folder. Added it to the toolbox and am able to use the controls as described. (I just added one to test in the screenshot)

    Thanks for offering to help. Hard to believe, but I'm still using VB5. A bit easier to believe, on Win 7. I gotta say, seeing all the crap folks go through with 10 and 11, 7 is bliss. I avoid web zero-day security issues by using the best script blocker ever, UMatrix. Too bad Google has made browser extensions less powerful for users of new versions of Chrome based browsers when they finally dropped manifest v2 for v3, which takes away extension's ability to hook into and filter traffic. But since I'm using Win 7, I can't even upgrade to the newer browsers, so UMatrix will keep working at Manifest v2 level.

    I was able to get the OCX onto the toolbar without any problem. Then after fiddling around a while with some of the controls I finally noticed with the listview that there were only the four events. Then I checked a few more controls to find the same. Maybe it's something to do with the COM plumbing between v5 and 6, some interface version issue.
    But seriously I don't have a clue. I saw where Krool wrote something to the effect that one would not have a good time using his controls on VB5, lol. So I was warned!

    On a thread here I found the link to WinWorldPC, an abandonware site that appears to be quite trustworthy. I downloaded the one VB6 ISO the site has, the Enterprise version, did the checksum, fine.. Then I tried something else, used Wayback to find an old version of the same page from 2014. It had mirror download links all different from on the present day page, and on the one I tried, on a French server, STILL ALIVE! So I downloaded that.. identical to the first copy I downloaded from the 2024 page. And now I've also located the final cumulative service pack 6 which is still available from MS, and the security rollups, which some say are half baked and might mess up things. I haven't gotten to installing yet, so much crap to get out of the way first..
    Last edited by philo; Feb 21st, 2025 at 01:20 PM.

  33. #3953
    Hyperactive Member
    Join Date
    Jul 2022
    Location
    Buford, Ga USA
    Posts
    488

    Re: CommonControls (Replacement of the MS common controls)

    Ah, I see yeah definitely want to move VB up. You may consider twinBASIC as well. Here is the forum https://www.vbforums.com/forumdisplay.php?108-TwinBASIC
    I use Widows 11 Pro w/o issues, but I like to keep my hardware fairly updated (within 4-5 years, though I just updated to a 9070X to beat the tariffs hitting our shores now, my setup was overdue)

    I will say, Win 7 was awesome and I miss its performance. Even with 48gb DDR5 RAM, RX 7800XT and fast M.2 NVMe drives, Win 11 doesn't feel as snappy as Win 7 does even in a Virtualbox VM ha!
    (truth be told I've not spent much time fine tuning since building it on the 6th)

    Good luck with your updates, that'll take a bit of work.

  34. #3954

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,547

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Karl77 View Post
    I have a kind of 'solution'.
    In the ListBoxW source, I added a DoEvents on WM_KILLFOCUS:

    Code:
    Private Function WindowProcControl(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Select Case wMsg
        Case WM_SETFOCUS
            If wParam <> UserControl.hWnd Then SetFocusAPI UserControl.hWnd: Exit Function
            Call ActivateIPAO(Me)
        Case WM_KILLFOCUS
            Debug.Print "WM_KILLFOCUS"
            DoEvents
            Call DeActivateIPAO
        Case ...
    This fixes the flickering completely.
    I'm not sure yet if there are side effects from this addition.

    Later:
    I don't feel fine with the DoEvents.
    So I tried this:

    Code:
        Case WM_KILLFOCUS
            Debug.Print "WM_KILLFOCUS"
            Call DeActivateIPAO
            Exit Function
    Exit Function cures the flicker as well.
    It is also happening "sometimes" in the VB6 ListBox when using visual styles. So, I get the feeling that this is something to do with the underlying API window class and not specific with VBCCR.
    Of course when somebody can provide a clever solution it would be good. To just cancel out WM_KILLFOCUS sounds like getting side-effects.

  35. #3955
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    533

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    It is also happening "sometimes" in the VB6 ListBox when using visual styles. So, I get the feeling that this is something to do with the underlying API window class and not specific with VBCCR.
    Of course when somebody can provide a clever solution it would be good. To just cancel out WM_KILLFOCUS sounds like getting side-effects.
    I don't cancel WM_KILLFOCUS, I only exit the message processing after work is done.
    Then new messages can come in and are processed.
    Perhaps I think too simple?

    Anyway, I use the control with the Exit Function change for ~ 10 days now successfully.
    No side effects to observe... try it.

Page 99 of 99 FirstFirst ... 498996979899

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