DEP issues are caused by some subclassing methods.
Do you do any subclassing? If yes, how?
However, I doubt if this is relevant to this thread.
Printable View
DEP issues are caused by some subclassing methods.
Do you do any subclassing? If yes, how?
However, I doubt if this is relevant to this thread.
VBCCR14.OCX v1.4.24
maybe i found a small bug at the ListBoxW:
the last item at the listbox always get unchecked automatically if i move a item up or down.
the code i use with a workaround (bold lines) for this problem:
Code:Public Function ListBoxW_Move_Item_UP(ListBox As VBCCR14.ListBoxW) As Boolean
Dim currIndex As Integer
Dim currItemText As String
Dim currItemChecked As Boolean
Dim currItemData As Long
Dim lastItemChecked As Boolean
Dim prevItemChecked As Boolean
20 With ListBox
30 If .ListIndex >= 1 Then
40 currIndex = .ListIndex
50 currItemText = .List(currIndex)
60 currItemData = .ItemData(currIndex)
70 currItemChecked = .ItemChecked(currIndex)
80 prevItemChecked = .ItemChecked(currIndex - 1)
90 lastItemChecked = .ItemChecked(.ListCount - 1)
100 .RemoveItem currIndex
110 .AddItem currItemText, currIndex - 1
120 .ListIndex = .NewIndex
130 .ItemData(.NewIndex) = currItemData
140 .ItemChecked(.NewIndex) = currItemChecked
150 If currIndex = .ListCount - 1 Then
160 .ItemChecked(.NewIndex + 1) = prevItemChecked
170 Else
180 .ItemChecked(.ListCount - 1) = lastItemChecked
190 End If
200 ListBoxW_Move_Item_UP = True
210 End If
220 End With
End Function
Code:Public Function ListBoxW_Move_Item_DOWN(ListBox As VBCCR14.ListBoxW) As Boolean
Dim currIndex As Integer
Dim currItemText As String
Dim currItemChecked As Boolean
Dim currItemData As Long
Dim lastItemChecked As Boolean
Dim nextItemChecked As Boolean
20 With ListBox
30 If .ListIndex <> -1 And .ListIndex < .ListCount - 1 Then
40 currIndex = .ListIndex
50 currItemText = .List(currIndex)
60 currItemData = .ItemData(currIndex)
70 currItemChecked = .ItemChecked(currIndex)
80 nextItemChecked = .ItemChecked(currIndex + 1)
90 lastItemChecked = .ItemChecked(.ListCount - 1)
100 .RemoveItem currIndex
110 .AddItem currItemText, currIndex + 1
120 .ListIndex = .NewIndex
130 .ItemData(.NewIndex) = currItemData
140 .ItemChecked(.NewIndex) = currItemChecked
150 If .NewIndex < .ListCount - 1 Then
160 .ItemChecked(.ListCount - 1) = lastItemChecked
170 Else
180 .ItemChecked(.NewIndex - 1) = nextItemChecked
190 End If
200 ListBoxW_Move_Item_DOWN = True
210 End If
220 End With
End Function
Update relased. Quite important when full "DPI Awareness" is needed.
Problem was that some properties are saved as pixels in the property bags. For example the TabFixedWidth property in the TabStrip control.
This issue was solved now by saving the pixels as DIPs (Device-independent pixels) in the Property bag.
The TabStrip, ToolBar, Pager and CoolBar control were affected.
This solution is a "soft" compatibility break.
When the developer has run the VB6 IDE at 100% (96) DPI there is no compatibility break.
If it was devevloped by another DPI setting the affected controls shall be recreated.
The OCX has also been updated. (and also the VBFlexGrid btw.)
Alert: concerning yesterday "DPI Aware" enhancement.
There is still a "trap" as I did not handled the UserControl_InitProperties. (only did ReadProperties and WriteProperties)
Fix for this will come asap.
Update released. Bugfixes for yesterday update for "DPI Aware" enhancement. Please replace again, sorry for the inconvenience caused.
Affects TabStrip, ToolBar and CoolBar control. (Pager control no change necessary)
Nevertheless there was no harm when having a DPI of 100% (96) in the VB6 IDE.
Now it should be possible to work in whatever DPI setting in the VB6 IDE and of course the compiled resulting target display.
Again update for "DPI Aware". After all that was kind of a hard nut to crack with the whole DPI Aware story..
In various controls I have done minor tweaks to improve appearance on higher DPI, for example:
- In ListBoxW with Style Checkbox or Option the state image (checkbox or optionbox) is now drawn in correct proportion. (15 * PixelsPerDIP_X())
- When in ListView.ColumnHeaders.Add no Width was specified the default width is now in correct proportion. (96 * PixelsPerDIP_X())
- and so on...
The improvements done in the functions PixelsPerDIP_X/PixelsPerDIP_Y is just simply that the first return value is preserved for all future calls.
This has two benefits:
1 - higher performance
2 - Consistent conversion between ReadProperties and WriteProperties
hi krool
it is a great job you are doing here solving most of vb6 standard controls problems we are facing for years including visual style and performance
I downloaded the project and here are the points
1- the buttons having the style graphical hides the caption until style property is refreshed or recalled during runtime
2- the filter button of listview is not visually styled even after compilation
this is what i remember for now concerning bugs
and for improvements , i have been trying to set the menus background color for toolbar buttons and i could not . i also did not get the exact line of code which creates the menus. i already have an example for coloring menus background but failed to combine it with your control , so why dont you add it . i think it is a serious matter for visual styling to abandon all grayed colors in favor of whiteness .
also for toolbar button menus it can not create submenus which is necessary
that`s for now
and lots of thanks for you for these great tools
hi krool ,
there is a bug when buttonsw are set to graphical style and having a backcolor , the caption is hidden and comes back when the property os set at runtime
listview column filter button is not visually styled even after compilation
the project you attatched loads normally but when i try to view the main form or run the project , the ide crashes . i made anew project and added the ocx and files for visual styling manually to solve this problem
for toolbar , i suggest adding the background color for menues to be white or to be a property to get rid of the grayed color
also the toolbar menues for buttons has no submenus
i want to thank you so much for this great job and i hope everyone can test it sothat we can be be able to trust it 100%
and sorry for bad english
sorry for double posting ,
i am working on listview and i will be testing it for the next few days because i am replacing the old one in some project and i found some bugs and i think all are connected to reading and setting properties for column headers
1- if a column header has an icon and you set the sort arrow then the icon disappears and vice versa maybe you intended this and not a bug
2- when i set -for example- the alignment property for some coulumn , nothing happens and it remains as it is . wen i changed the column index to another column , now both have the alignment i had previously chosen for the first column edited . i mean that the property does not respond until it is set to another item , and also keeps it for both
3- please , if there is a solution for the point that : i have to compile the whole project to see the visual effects and this is time consuming . is there a way to synchronize it with IDE ?
for listview column headers , is there a possibility for :
1- making them accept png transparent icons , like lavolpe`s image control ?
2 - making the column header text or caption accept vbclrf or vbnewline ? why ? it will be good to make benefit of this for adding the sum for a specific column , because if we add this value or string to the caption it will affect the column width or it will not be visible for the user and he has to widen the column to view this sum value which is supposed to be always visibe to the user
3- a suggestion for columns sorting , why dont you make a sort dropdown somewhere which displays a menu with all columns names and choosing this sort to be ascending or descending in a checked submenu ? this will solve the problem of sorting icon which removes the main icon for the header . this dropdown can also be visible or invisible depending on a property .
me especially appreciate this tremendous work and i wish i could help in developing it , but it crosses my knowledge border in most of its areas . so , thanks again
how to collapse a group after it is expanded ?
why the group subset items count is set only to the first group ?
suggestions :
1- making the listview much more ready for all functional operations like adding (select all - select none - select inverse ) for the group level and for all listview items level . and this will act for item checking or item selection (for multi selection property set to true)
2- after this , we may add this command list (delete selected/checked- highlight selected/checked) and we will make this command list more dynamic to enable the programmer to add more buttons to it like (print selected/checked) and so on ...
i am working on listview user control and i was developing all these functions to it , it was with win common controls 6 library which can not be themed and i need checkboxes within it which is not found with version 5 so i decided to use your listview and combine them together by replacing my 6th version with yours . so i will try to re-make my listview control and upload it here after i finish merging between them both
Update released.
Bugfix for ListBoxW concerning "DPI Aware". (again)
I cannot replicate that bug. I think somewhere in your code you might have a SetWindowLong GWL_STYLE for the button and that may kill of the BS_OWNERDRAW bit.
That's why you need to recall the Style property. Can you check if your doing something like this? (SetWindowLong GWL_STYLE)
That is by design from the comctl32.dll. No influence for this.
The .ButtonMenus property is meant for simple and rapidstart use. If you want to have custom background menu and submenus do as following:
Don't set any ButtonMenu in .ButtonMenus, instead handle the event 'ButtonDropDown' and create your own menu there.
That is not a bug. If you set a sort arrow the icon will not be visible but remain. When you now remove the sort arrow the icon will re-appear.
I cannot replicate that bug. Please provide full example.
You can manifest the VB6.exe and thus enable theming in the IDE. See here: http://www.vbforums.com/showthread.p...ues&highlight=
Use the Group.Collapsed property. (also verify that Group.Collapsible property is set accordingly)
This is just in the demo. You can make any group to subset items. Use the Group.Subseted = True in order to do so.
thanks for your reply krool ,
i have been playing with the listview control and did some practices on it to get to know its properties and methods and things are better now .
but still some issues
for button , here is the scenario . i did it on an empty project only containing the command on a form
1- add a button
2- change style property to to graphical
3- change its backcolor to some color like "blue"
4- change its forecolor to "red"
5- change the appearance property to "flat" , now , what happens is the whole button is white . the backcolor property is "white" instead of blue , and this is ok , we can rechange it , but the forecolor is still red and it does not appear on the button even when we change it to any other color i mean by refreshing the property .
6- i mean setting the property to flat is the point . the button has to be refreshed after setting it its appearanace to flat . mainly by refreshing the style property
this is for the button
for listview column properties , i will uploade this bug after i determine it exactly and with pictures
Another option of making the IDE themed without modifying the exe, can be found here. It does have the advantage of being able to change the manifest without re-modifying the exe. Just another option.Quote:
You can manifest the VB6.exe and thus enable theming in the IDE. See here: http://www.vbforums.com/showthread.p...ues&highlight=
In your original link you included this statement: "Reason for this is that adding a manifest file into the VB6.exe directory won't work anymore in Windows 7." I've always been able to get the external manifest to work, but may require a registry edit & reboot at most. The registry edit can be undone after the manifest takes effect. Am currently using external manifest in Win10.
for listview columns , i cant re-simulate the error i mentioned above .maybe i was doing sth wrong .
but there is a bug i think
the column 2 size displays like thisCode:lvmain.ColumnHeaders.Add(, , "Col1").Alignment = LvwColumnHeaderAlignmentCenter
lvmain.ColumnHeaders.Add(, , "Col2").AutoSize LvwColumnHeaderAutoSizeToHeader
lvmain.ColumnHeaders.Add(, , "Col3").ForeColor = vbRed
lvmain.ColumnHeaders.Add(, , "Col4").CheckBox = True
lvmain.ColumnHeaders.Add(, , "Col5").Checked = True
lvmain.ColumnHeaders.Add(, , "Col6").Icon = 1
lvmain.ColumnHeaders.Add(, , "Col7").SplitButton = True
Attachment 150091
there is another problem in IDE , when selecting a backcolor property for any control , the system colors show normally while the palette shows like this . and this happened after i followed the instruction you have provided for theming IDE
Attachment 150093
[QUOTE=LaVolpe;5196541]Another option of making the IDE themed without modifying the exe, can be found here. It does have the advantage of being able to change the manifest without re-modifying the exe. Just another option.
thanks so much lavolpe for your precious notices .
and I want to thank you for all what you are doing here in the forum , I have been developing with vb6 for 9 years and i have never joined a forum until i saw some fresh posts for you and krool and i am now happy to be a part of this . i found that you mainly concentrate on visual styling for interface and images and this graphical area is not so good in vb6 . you have solved many problems for me especially by your alpha image control . and krool also with this replacement tool which is great at visual and functional levels . just wanted to let you know that you were the main reason for me registering for this forum and to tell you that you are doing great things
This is a bug in the IDE when the IDE is manifested to use themes. It is very, very annoying. I've been using a manifest with IDE for several years and am not so annoyed as I used to be. Just got used to it.Quote:
there is another problem in IDE , when selecting a backcolor property for any control , the system colors show normally while the palette shows like this . and this happened after i followed the instruction you have provided for theming IDE
The system colors tab does work, so use that to select system colors.
For the non-system colors, the palette, a workaround would be to use the Palette from the IDE menu: View | Color Palette. The palette offered to you from that menu item can set either the forecolor or backcolor properties or both.
Also know that you can copy & paste the color values from other properties on that property sheet if another property already has the color you want.
What you mean by "the forecolor is still red and it does not appear on the button". You mean the caption is not visible?
I can't reproduce such behavior. The control will be refreshed when setting the Appearance property.
Can you wrap this in a demo?
https://www.youtube.com/watch?v=edxxiw8Q-98
here is a video demonstration for both command and listview errors
The command bug was a real one. However, it only affected the OCX version, which you are using. That's why I could not replicate it in the first place.
But now it's fixed. Thanks for reporting.
The bug was related to subclassing while in design mode. That's why that bug occured only in design mode and not at run-time.
This fix might also solved other similar problems in other controls, which are not yet detected. But now they can't be detected anymore. :)
The listview error is not a bug. It is normal behavior.
To solve this you need to process like this:
Instead of doing like this:Code:ListView1.ColumnHeaders.Add , , "Col1"
ListView1.ColumnHeaders.Add , , "Col2"
ListView1.ColumnHeaders.Add , , "Col3"
ListView1.ColumnHeaders.Add , , "Col4"
ListView1.ColumnHeaders(2).AutoSize LvwColumnHeaderAutoSizeToHeader
Reason: When doing autosize to columnheader "Col2" at time of autosizing it is the "last" columnheader. And then it's sized to right side of client edge.Code:ListView1.ColumnHeaders.Add , , "Col1"
ListView1.ColumnHeaders.Add(, , "Col2").AutoSize LvwColumnHeaderAutoSizeToHeader
ListView1.ColumnHeaders.Add , , "Col3"
ListView1.ColumnHeaders.Add , , "Col4"
To avoid this just add all columnheaders and do autosizing afterwards.
Nice work krool .
for listview i had already processed my code like what you have just provided to solve this error . and i also recommend that all autosizing is set even after listview items population because of "lvwColumnHeaderAutoSizeToitems" has to know the max length of all items .
think about these improvements . i think they are easy to be included compared to this massive work and will increase usability level for listview
1- listview column header backcolor
2- listview item alternate row color (items backcolor)
3- this one is necessary and will solve many problems :: making the header multiline or adding a sub-header or may be a footer to display sum or overage values for numerical columns if the user needs this function for both group level and all items level .
4- select all/none/inverse
5- command list which is dynamic for commands to be added maybe with default buttons like(delete-highlight .....) for checked or selected records
6- alias for bool values like say ( "in stock" if true ) ( "out of stock" if false )
7 - the most important one i think is related to working with touch screens . can we make listview scrolling is called by mousedown of listview . because it is annoying when in touch screens catching the scrollbar and scrolling is not a comfort
i am working on these improvements already , but i think it will be well more engineered if you make them in your original control
Attachment 150123Attachment 150125
what do I have to add to my program when using the ocx version in order to get the xp themed controls.
I always use a manifest, but for a quick small app, I don't want that
I know it has been posted here, I just cant find it
Update released.
I am puzzled why this bug remained for so long..
The X/Y param in the MouseDown/MouseMove/MouseUp event on controls with child windows, e.g. edit control, were wrong.
This is due to fact that each window starts from 0,0 coord.
Best example to illustrate is the IPAddress control, the X param started again from 0 on each of the 4 edit controls when moving the mouse from left to right:
Attachment 150525
This bug was easy to fix to just make a conversion via MapWindowPoints to the main control window.
Affected were the IPAddress, ComboBoxW, ImageCombo, SpinBox and DTPicker control. Basically those controls who have "shared" mouse events for both main and child controls.
The OCX was also updated.
hi Krool,
two more bugs found:
1. listview: the alignment of the checkboxes with view mode "list" are always top-left and dont align with the item text. see 1. control at the screenshot.
2. listbox: the item with the longest text at a listbox is always cutted at the end when using multicolumn and checkboxes. see 2. control at the screenshot.
Attachment 150541
Hi Krool,
There seems a problem with the Toolbar height on initial run. It is too short (as in icons are truncted or if there are text then text height is truncated. This is seen when I have a control below the toolbar and I resize it to fill.
On Form_Load, I understand the Form_Resize will be fired. But it seems that at this point of the run, the toolbar height is incorrect. After the form is shown, toolbar height then is correct and another manual Form_Resize will correct things.
I am using 28x28 icons for the toolbar.
Attachment 150549
1. I cannot replicate that issue. Please provide a demo project.
2. Use the .SetColumnWidth method. This method is likewise to the .net equivalent method. Therefore you can read the msdn article about how to best to use it.
https://msdn.microsoft.com/en-us/library/1w4k926x.aspx
By default the windows toolbar has icon of 16x15 pixels but computes the button size as if the images were 16x16 pixels.
However, when you have an ImageList with a different icon size it will be recognized after Form_Load.
Since the ImageLists are assigned after it, it is not possible to assign during UserControl_ReadProperties.
A workaround solution would be to do following during Form_Load, then you have the correct height immediately:
Beside this workaround there is no other immediate solution now possible.Code:Private Sub Form_Load()
Set ToolBar1.ImageList = ToolBar1.ImageList
Debug.Print "Form_Load: " & ToolBar1.Height
Its easy to replicate without a demo project.
Just set the listview font type to "MS Sans Serif" and the font size to 12.
The checkbox will always stay top-left and not align-center with the item text:
Attachment 150571
I could fixed the problem with the listbox method .SetColumnWidth in combination with the api "GetTextExtentPoint32W" to determine the width of the largest item text.
Looks much better now:
Attachment 150573
found a visual bug with calendar, and dropdown calendar (DTPicker1)
on a french computer (Canada French) the word Today is "Aujourd'hui" wich is large. The date at end is truncated, check the number 13 in the picture.
Attachment 150611
also, DTPicker1 doesn't have a min size and can be resized in a way where it's not possible to select it anymore in IDE with the mouse
not sure I understand your question. Krool tools is a REDESIGNED of original control, it has nothing to do with the old control it's a redraw of them
the original control didn't had this problem.....
therefore, a bug in the "new" (Krool) control.
Edit: Ms Control is already available in Vb6 without help of Kroll so not sure what u meant...
Not sure your statement is correct. If you look at the datepicker.ctl, you will not see anywhere within it where Krool paints/draws the control. At least I didn't see any such statements. Krool creates an instance of the SysDateTimePick32 class (CreateDTPicker() routine) and exposes it via his usercontrol. So, from a cursory look at his code, doesn't look like he's redesigned anything significant, but mostly added support for unicode. However, what you are showing in your screen capture may indicate the font property should be changed (by you & preferably true-type) or some method called (by Krool) that would force the datepicker to adjust size based on font. Just a guess though.
ah no problem. I think you now know that Krool's controls simply wrap the existing controls found in comctl32.dll.
so we have 4 different controls we can use in VB6.
* comctl32.dll <-- use the API manually
* ComCtrls v5 OCX <-- wraps the controls in comctl32.dll in user controls
* ComCtrls v6 OCX <-- based on the source of comctl32.dll (windows XP version), but is independent.
* Krools Controls <--- wraps the controls in comctl32.dll in user controls
If you want to learn about the Windows Common Controls, MSDN has a huge reference to the APIs.
https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
Regardless, does the same bug show up in .NET's DTPicker control?