-
Jan 29th, 2025, 10:03 AM
#3921
Re: CommonControls (Replacement of the MS common controls)
-
Jan 29th, 2025, 10:46 AM
#3922
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Arnoutdv
You can alternatively use the OLEObjectsAddFromPicture method which doesn't mess with the clipboard.
-
Jan 29th, 2025, 10:48 AM
#3923
New Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Arnoutdv
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.
-
Jan 29th, 2025, 11:31 AM
#3924
New Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
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 >
-
Jan 29th, 2025, 11:33 AM
#3925
New Member
Re: CommonControls (Replacement of the MS common controls)
-
Jan 29th, 2025, 12:10 PM
#3926
New Member
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.
-
Feb 7th, 2025, 06:38 AM
#3927
Member
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!
-
Feb 7th, 2025, 01:46 PM
#3928
New Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by clintc
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
-
Feb 8th, 2025, 02:33 AM
#3929
Member
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!
-
Feb 8th, 2025, 11:58 PM
#3930
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
-
Feb 9th, 2025, 02:36 PM
#3931
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by SearchingDataOnly
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

tB RC5

~2x instantiate improvement and ~1000x destruction improvement.
-
Feb 9th, 2025, 03:26 PM
#3932
Re: CommonControls (Replacement of the MS common controls)
tbRichClient5? That’s interesting!
-
Feb 9th, 2025, 04:53 PM
#3933
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Arnoutdv
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.
-
Feb 9th, 2025, 04:54 PM
#3934
Re: CommonControls (Replacement of the MS common controls)
Anyway this is getting off topic, so we best move on (sorry Krool!)
-
Feb 10th, 2025, 09:57 AM
#3935
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.
-
Feb 12th, 2025, 07:08 AM
#3936
Fanatic Member
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?
-
Feb 12th, 2025, 09:31 AM
#3937
Member
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.
-
Feb 12th, 2025, 09:49 AM
#3938
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
It's about the flashing ListboxW on losing focus. Setfocus on MouseMove is for demo only.
-
Feb 12th, 2025, 09:50 AM
#3939
Member
Re: CommonControls (Replacement of the MS common controls)
-
Feb 12th, 2025, 11:40 AM
#3940
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by jpbro
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
tB RC5
~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.
-
Feb 12th, 2025, 12:41 PM
#3941
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
(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
-
Feb 12th, 2025, 07:06 PM
#3942
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
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?
-
Feb 13th, 2025, 01:53 AM
#3943
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Mith
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)
-
Feb 13th, 2025, 02:37 AM
#3944
Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
(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.
-
Feb 13th, 2025, 03:34 AM
#3945
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by clintc
I still see no difference.
Attachment 194196
Download and remove the zip extension.
Last edited by Karl77; Feb 13th, 2025 at 03:42 AM.
-
Feb 13th, 2025, 03:50 AM
#3946
Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
There is no attachment there.
-
Feb 13th, 2025, 04:00 AM
#3947
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
-
Feb 13th, 2025, 04:09 AM
#3948
Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
Yes, that is indeed strange.
But sorry, I do not see that flicker with the project on my system.
-
Feb 13th, 2025, 06:01 AM
#3949
Fanatic Member
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.
-
Feb 19th, 2025, 10:47 AM
#3950
Junior Member
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.
-
Feb 20th, 2025, 08:39 AM
#3951
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.
-
Feb 21st, 2025, 01:06 PM
#3952
Junior Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by jdelano
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.
-
Feb 21st, 2025, 03:05 PM
#3953
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.
-
Feb 25th, 2025, 09:44 AM
#3954
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
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.
-
Feb 25th, 2025, 03:07 PM
#3955
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|