-
Re: CommonControls (Replacement of the MS common controls)
2.
Maybe you don't have a manifest to be DPI-Aware ? So windows is bitmap scaling and maybe messes up with the checkbox image as that maybe is scaled differently..
So try a manifest or check if that issue persists in 100% DPI.
3.
You can use .Cell(FlexCellSort... to avoid changing the caret (.Col = Col or .Row = Row) at all.
-
Re: CommonControls (Replacement of the MS common controls)
Hallo Krool,
Using you ListView is extremely slow on my W7 machine.
To load 900 items (adding3 subitems) takes about 30 sec.
I turned off VisualStyles property, but it hardly helped.
(I use .Redraw = false when loading)
When I swap out the your ListView with the one from Common Controls Ocx v6, it only takes 1 sec.
Can you help out?
Thank you in advance!!
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
2.
Maybe you don't have a manifest to be DPI-Aware ? So windows is bitmap scaling and maybe messes up with the checkbox image as that maybe is scaled differently..
So try a manifest or check if that issue persists in 100% DPI.
3.
You can use .Cell(FlexCellSort... to avoid changing the caret (.Col = Col or .Row = Row) at all.
For 2., I tested with 100% scaling but still no go. It's okay. I can live with it.
For 3., I will try it but I'm not sure how it works yet. Have to dig into it.
The major headache now is 1.
I uploaded 2 new videos to youtube to show some bizarre scenarios where:
a) setting VBCCR18 listitem.checked=true/false triggers itemchecked event even when application.enableevents=false
https://youtu.be/8hHECRpTaWo
b) setting MSCOMCTL listitem.checked=true/false via Excel VBA code doesn't trigger ItemCheck event and also independent of application.enableevents
https://youtu.be/OJJElXM4ZI8
Even though I said it's a headache, I got over that issue with ItemCheck event using a module level variable so this is just me reporting my weird findings.
And there's a new issue No.4 with VBCCR18, showing an empty line when listitems were added which did not happen with MSCOMCTL listview or vbflexgrid.
c) VBCCR18 listview visible extra row (at the bottom) after adding listitems (though NO extra listitem was added)
https://youtu.be/SeKV1s2aD-o
d)MSCOMCTL listview NO extra row visible after adding listitems
https://youtu.be/DmccNE3_Am8
Sorry to be bothering you with too many issues.
I am just reporting my findings while always thanking you, for these controls.
-
Re: CommonControls (Replacement of the MS common controls)
tragicshadow,
The list item height is slightly different from MS to VBCCR. When you want to set the height of the ListView exactly to a certain count of list items then use .ComputeControlSize.
clintc,
please provide demo replicating your issue.
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Thanks for responding!
I think the problem is on my side.
I will test on Monday or Tuesday again and let you know!
-
2 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
tragicshadow,
The list item height is slightly different from MS to VBCCR. When you want to set the height of the ListView exactly to a certain count of list items then use .ComputeControlSize.
Krool, I will play with .ComputeControlSize.
Please allow me to ask for another issue. Really sorry about that especially during a weekend.
I am not sure how to assign an array into a VBCCR18 ComboboxW.List.
For the MSCOMCTL, we can assign just like Combobox.List=Array(1,2,3,4,5) and there is also support for multiple-column dropdown using the ColumnCount and ColumnWidths properties too.
Attachment 193935
But for VBCCR18, I can't just assign an array to the .List like that because it keeps giving error like "Argument not optional".
I tried different ways to use Index to assign single values or array of values but there's just no love.
Attachment 193936
I understand that they are of different data types and that I can use a loop with VBCCR18 ComboBoxW.AddItem, I am just wondering whether there's a way to add to ComboBoxW's list that I didn't know and is it possible to use a multi-column dropdown?
Thanks in advance.
-
Re: CommonControls (Replacement of the MS common controls)
Hello, this is my first post so apologies if this has already been asked before.
I've checked the version 1.8 Krool CommonControls (Replacement of the MS common controls) revision history and haven't found any reference to the following.
The replacement imagecombo control (I'm using the ActiveX Control version) doesn't appear to include either backcolor nor forecolor properties like the MS common controls imagecombo has, is this something that is possible or likely to be implemented?
Many thanks for a great project.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
cydonia
Hello, this is my first post so apologies if this has already been asked before.
I've checked the version 1.8 Krool CommonControls (Replacement of the MS common controls) revision history and haven't found any reference to the following.
The replacement imagecombo control (I'm using the ActiveX Control version) doesn't appear to include either backcolor nor forecolor properties like the MS common controls imagecombo has, is this something that is possible or likely to be implemented?
Many thanks for a great project.
Unfortunately it's not possible. The ImageCombo (ComboBoxEx class) is a MS superclassed owner-drawn combo box control.
We would need to overwrite complete owner-drawing which would nullify the ImageCombo per se, as you can then just resort to a normal ComboBox and set DrawMode accordingly.
The MS ImageCombo is a zombified ComboBoxEx and include the source code directly, so they could influence the colors. It's unfair but that's how it is..
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
The problem was that the property "Sorted" was set to True prior to loading the data.
Setting it to false afterwards solved the problem!
Thank you!
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
IMAGE COMBO QUESTION
I have an ImageCombo with images and text.
When an item is selected, the ImageCombo has the focus.
The image is also focused and doesn't look good.
The image is clear when I move the focus to another control (e.g. on ImageCombo1_CloseUp).
I want the image to be clear when an item is selected.
Is there a way to do this without moving the focus to another control?
Attachment 193975
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
IMAGE COMBO QUESTION
I have an ImageCombo with images and text.
When an item is selected, the ImageCombo has the focus.
The image is also focused and doesn't look good.
The image is clear when I move the focus to another control (e.g. on ImageCombo1_CloseUp).
I want the image to be clear when an item is selected.
Is there a way to do this without moving the focus to another control?
Attachment 193975
I am not aware of how to avoid that. The ComboBoxEx class is using the ILD_SELECTED flag when using ImageList_Draw.
To overcome that you would need to to use the classic ComboBox and use DrawMode as OwnerDrawn and draw it yourself.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
I am not aware of how to avoid that.
I thought I'd miss a simple setting or so.
SOLVED:
No problem at all, I set the ImageCombo in a PictureBox and set the focus to it.
Thanks Krool
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
tragicshadow,
The list item height is slightly different from MS to VBCCR. When you want to set the height of the ListView exactly to a certain count of list items then use .ComputeControlSize.
Krool, VBCCR18 listview ocx version, doesn't respect the columnwidth set when the columns were first added like:
Code:
LV1.columnheaders.add Text:="abc", Width:=0
and had to be set again after all listitems were loaded like
Code:
LV1.columnheaders(1).Width=0
to hide them in report view.
And I wish that the columnheaders(1).autosize=false to turn off column autofit feature from adjusting the column width so that columnwidths would stay the same as when they were first added, rather than setting them again later after the listitems were loaded.
Above situation can be view at:https://youtu.be/qlDB1bLFznc
Thanks in advance.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
tragicshadow
Krool, VBCCR18 listview ocx version, doesn't respect the columnwidth set when the columns were first added like:
Code:
LV1.columnheaders.add Text:="abc", Width:=0
and had to be set again after all listitems were loaded like
Code:
LV1.columnheaders(1).Width=0
to hide them in report view.
And I wish that the columnheaders(1).autosize=false to turn off column autofit feature from adjusting the column width so that columnwidths would stay the same as when they were first added, rather than setting them again later after the listitems were loaded.
Above situation can be view at:
https://youtu.be/qlDB1bLFznc
Thanks in advance.
What you mean from adjusting the column width ? You can use ListView1.ColumnHeaders(1).Resizable = False so that a user cannot resize a column. Is that what you meant ?
If confirm that the Width argument is flaw at interface design.. It should have been
Code:
Optional ByVal Width As Variant
instead of
Code:
Optional ByVal Width As Single
.
Because the "default" width is now applied when Width is 0, but it should be only the default width when the argument is missing. When 0 is supplied the width should really be zero and not resorting to the default width.
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
tragicshadow, good news. I managed to update the type lib to change the
Code:
Optional ByVal Width As Single
into
Code:
Optional ByVal Width As Variant
and this fixes your issue of:
Code:
LV1.columnheaders.add Text:="abc", Width:=0
not working before. But now it works as the MS ListView control. When Width argument is missing at all it applies the default width, then as intended.
Thanks for pointing this bug out.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Update released.
tragicshadow, good news. I managed to update the type lib to change the
Code:
Optional ByVal Width As Single
into
Code:
Optional ByVal Width As Variant
and this fixes your issue of:
Code:
LV1.columnheaders.add Text:="abc", Width:=0
not working before. But now it works as the MS ListView control. When Width argument is missing at all it applies the default width, then as intended.
Thanks for pointing this bug out.
Krool, thanks for fixing that issue. Confirmed solved.
One more thing, whenever I clicked the last visible row, NOT the last row, in a Listview, let's say containing like 20 rows, which is currently showing only the first 10 rows with row10 at the visible bottom, the rows automatically scrolled and showed me row11 without my intent.
mscomctl listview doesn't have this behaviour. I am not saying it is wrong or bad because I have seen the same thing in some other windows applications.
Could you please give us some form of control over that to not do it?
I think this is the reason behind my earlier report (#3903 numbered c) about an inactive row added at the end of Listview.
Thanks again for all your hard work!
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
tragicshadow
Krool, thanks for fixing that issue. Confirmed solved.
One more thing, whenever I clicked the last visible row, NOT the last row, in a Listview, let's say containing like 20 rows, which is currently showing only the first 10 rows with row10 at the visible bottom, the rows automatically scrolled and showed me row11 without my intent.
mscomctl listview doesn't have this behaviour. I am not saying it is wrong or bad because I have seen the same thing in some other windows applications.
Could you please give us some form of control over that to not do it?
I think this is the reason behind
my earlier report (#3903 numbered c) about an inactive row added at the end of Listview.
Thanks again for all your hard work!
You designed the UI and height based on the old controls.
The new ListView has slightly different item heights which causes non-integral height and thus causes a scroll when you click on the half visible 11 row.
Solution 1: use no manifest, thus VBCCR links to old comctl32 v 5.8
Solution 2. Use .ComputeControlSize to change your UI during Form_Load.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
You designed the UI and height based on the old controls.
The new ListView has slightly different item heights which causes non-integral height and thus causes a scroll when you click on the half visible 11 row.
Solution 1: use no manifest, thus VBCCR links to old comctl32 v 5.8
Solution 2. Use .ComputeControlSize to change your UI during Form_Load.
Hi, Krool, you ARE so right! It works now, I mean adjusting the height of VBCCR18 listview. There is NO extra row at the end and NO more scrolling up unnecessarily.
I did try the .ComputeControlSize as soon as you mentioned it several posts above, but then I failed to get it working.
I must admit that I have never seen or use that sub before. So, I assumed WRONGLY that I have to use the ProposedWidth and ProposedHeight because I misunderstood them like "if I set Width:=currentWidth and Height:=currentHeight and the Sub will propose suitable width and height in ProposedWidth and ProposedHeight!" after execution but then the returned(set) ProposedWidth and ProposedHeight were always the same as I set them before calling it.
I search for others' examples on using .ComputeControlSize and I found an example but it was totally different from your method, so, I got more confused.
I also found your code in your comment here,
and I realized from your code that I have to use the actual Width and Height arguments and then, BAMM! it returned the corrected Width and Height, though in my case, I can use only Height as not all my columns are of the same width.
My apologies for misunderstanding your kind instructions and many thanks for your help.
-
Re: CommonControls (Replacement of the MS common controls)
Important note!
When updating VBCCR18.OCX the interface of the Add method in LvwColumnHeaders changed.
For compiled exe this can cause a crash, so just re-compile the exe. The project will run fine in the IDE of the new updated VBCCR18.
Just compiled exe are affected which uses ListView column headers. It will crash on the Add method. So again, re-compile exe fixes the crash.
Sorry, but this must have been fixed as this was a critical bug and to match behavior with MS ListView.
-
Re: CommonControls (Replacement of the MS common controls)
greetings krool, with your rich textbox control, is this possible ? a textbox that accepts text and pictures can also be pasted in ? i would like the user to have note taking ability's, but more than just text, sometimes the user will want to take screen shots of an area of the desktop. that needs to fall into the rich textbox control . much like in ms word. text is great but sometimes a pic speaks volumes. right now if i try to paste a screenshot into the richtextbox a path to the file is inserted instead of the pic. i'm using the program called greenshot to grab a piece of the desktop. perhaps i should use a different screenshot program that fits the richtextbox better ?
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Arnoutdv
You can alternatively use the OLEObjectsAddFromPicture method which doesn't mess with the clipboard.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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 >
-
Re: CommonControls (Replacement of the MS common controls)
-
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.
-
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!
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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
-
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!
-
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
-
2 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
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
Attachment 194158
tB RC5
Attachment 194159
~2x instantiate improvement and ~1000x destruction improvement.
-
Re: CommonControls (Replacement of the MS common controls)
tbRichClient5? That’s interesting!
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Anyway this is getting off topic, so we best move on (sorry Krool!)
-
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.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
LISTBOXW question
See sample project:
Attachment 194181
When a ListBoxW loses focus, it flickers.
Up to now I couldn't find a way around this.
Can you help?
-
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.
-
Re: CommonControls (Replacement of the MS common controls)
It's about the flashing ListboxW on losing focus. Setfocus on MouseMove is for demo only.
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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
Attachment 194158
tB RC5
Attachment 194159
~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.
-
2 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
(LISTBOXW problem)
Quote:
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):
Attachment 194184
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.
Attachment 194185
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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):
Attachment 194184
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.
Attachment 194185
I still see no difference.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
clintc
I still see no difference.
Attachment 194196
Download and remove the zip extension.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
There is no attachment there.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
Yes, that is indeed strange.
But sorry, I do not see that flicker with the project on my system.
-
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.
-
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.
-
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)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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..
-
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
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.
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool and others,
I have a a question about the combobox control.
I'm using it in a search form where the user first selects a fields from the first list. This populates the second combo with the unique values from a database. As the search can more than "equal to" (e.g. larger than, smaller than, etc.) I'm using the style CboStyleDropDownCombo for the second combo.
However, some of the fields don't allow free text of numbers, but are Yes/No, or another fixed set of options like different statuses. In that case I prefer the combo style to be CboStyleDropDownList.
Now I discovered that this setting can't be changed at runtime. What would be the best way around this?
Thanks,
Erwin
-
Re: CommonControls (Replacement of the MS common controls)
I always go for the most simple solution.
In this case I would have multiple (hidden) combobox controls on my form and then show and use the one which suits the current needs.
-
5 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Thanks for the great work.
I would like to report a strange behavior in the FrameW control.
When using multiple subframes inside a frame sometimes a black line appears above one of the subframes.
The same thing also happens when overlapping frames containing other frames.
I attach some screenshots of my project to illustrate the strange effect.
This is the main window in the design phase. The frame that creates problems is the OTHER SOUND SYSTEM subframe contained in the lowest frame (MIDI DEVICES MANAGER).
Attachment 194435
This is the Main window of my project in the execution phase.
Attachment 194436
This is the same window with the MIDI DEVICES MANAGER frame repositioned and displayed.
The strange effect with the black line does not appear yet.
Attachment 194437
I noticed that the black line effect never appears if the subframe is not completely contained within the main window (red arrow).
When instead the frame is moved up so as to be entirely contained in the window the black line effect always appears above the frame (red arrow).
Attachment 194438
I also noticed that the first time I reposition and display the MIDI DEVICES MANAGER main frame the black line never appears.
Attachment 194439
But the black line always appears from the second time I display the MIDI DEVICES MANAGER frame.
I tried changing various graphic settings but the black line effect always appears. So I think it is some kind of control bug.
I thought I would report it so that it can be used to further improve the CommonControls Replacement project.
Thanks for your attention.
-
Re: CommonControls (Replacement of the MS common controls)
Yes, I also see that happening!
-
Re: CommonControls (Replacement of the MS common controls)
The issue with the black line appears to be the DrawThemeParentBackground and the WM_PRINTCLIENT handler.
So, either I remove the WM_PRINTCLIENT handler or remove the DrawThemeParentBackground.
Since it makes maybe sense for "transparent" BP_GROUPBOX style windows to use DrawThemeParentBackground it makes definitely no sense for the FrameW control which is isolated in a UserControl with a fixed BackColor.
The "Transparent" property of the FrameW can be used to draw a fake replica of the parent background already. So there is no need here for DrawThemeParentBackground.
Update released. Fixed. Thanks for reporting !