Yes, confirmed.
Drastically is the right term.
Wow!
My settings dialog loads in an acceptable time now.
Also there is no real difference if started by mouse click or Enter.
I'm very curious how this mouse/Enter difference came.
I can't imagine...
Printable View
one of my users gets an error window titled VBCCR15 which states the run-time error -2147024770 when starting my app.
he uses win8.1x64 but i cant reproduce this error when using win8.1x64.
i already googled for -2147024770 but no results.
any hints how to fix that?
sounds like a deployment issue. How was VBCCR installed?
Hi Krool
I'm trying to save the content of the TextBoxWs in inifiles but when I load them I'm getting question marks.
The content of the TextBoxWsis is in Arabic Language.
This is how I'm doing:
For Saving
For LoadingCode:If TypeOf ctl Is TextBoxW Then
RetVal = WriteToAppINI(Me.Name & "Control", ctl.Name & " FontSize", CStr(ctl.Font.Size), App.Path & "\MyAppSettings.dat")
RetVal = WriteToAppINI(Me.Name & "Control", ctl.Name & " text", CStr(ctl.text), App.Path & "\MyAppSettings.dat")
RetVal = WriteToAppINI(Me.Name & "Control", ctl.Name & " FontName", CStr(ctl.Font.Name), App.Path & "\MyAppSettings.dat")
RetVal = WriteToAppINI(Me.Name & "Control", ctl.Name & " Font_CharSet", CStr(ctl.Font.Charset), App.Path & "\MyAppSettings.dat")
RetVal = WriteToAppINI(Me.Name & "Control", ctl.Name & " FontBold", CStr(ctl.Font.Bold), App.Path & "\MyAppSettings.dat")
RetVal = WriteToAppINI(Me.Name & "Control", ctl.Name & " FontItalic", CStr(ctl.Font.Italic), App.Path & "\MyAppSettings.dat")
End If
Code:If TypeOf ctl Is TextBoxW Then
ctl.Font.Size = ReadFromAppINI(Me.Name & "Control", ctl.Name & " font.size", ctl.Font.Size, App.Path & "\MyAppSettings.dat")
ctl.text = ReadFromAppINI(Me.Name & "Control", ctl.Name & " text", ctl.text, App.Path & "\MyAppSettings.dat")
ctl.Font.Name = ReadFromAppINI(Me.Name & "Control", ctl.Name & " Font.name", CStr(ctl.Font.Name), App.Path & "\MyAppSettings.dat")
ctl.Font.Charset = ReadFromAppINI(Me.Name & "Control", ctl.Name & " Font_CharSet", ctl.Font.Charset, App.Path & "\MyAppSettings.dat")
ctl.Font.Bold = ReadFromAppINI(Me.Name & "Control", ctl.Name & " Font.Bold", ctl.Font.Bold, App.Path & "\MyAppSettings.dat")
ctl.Font.Italic = ReadFromAppINI(Me.Name & "Control", ctl.Name & " Font.Italic", ctl.Font.Italic, App.Path & "\MyAppSettings.dat")
End If
Code:Public Function ReadFromAppINI(SectionHeader As String, VarName As String, ByVal Default As String, strFile As String) As String
Dim RetStr As String
RetStr = String(255, Chr(0))
ReadFromAppINI = Left(RetStr, GetPrivateProfileString(SectionHeader, ByVal VarName$, Default, RetStr, Len(RetStr), strFile))
End Function
Any idea please?Code:Public Function WriteToAppINI(strSection As String, strKeyName As String, strValue As String, strFile As String) As Long
Dim intStatus As Long
On Error GoTo PROC_ERR
intStatus = WritePrivateProfileString(strSection, strKeyName, strValue, strFile)
WriteToAppINI = (intStatus <> 0)
PROC_EXIT:
Exit Function
PROC_ERR:
MsgBox "Error: " & Err.Number & " " & Err.Description, , "WriteToAppINI"
Resume PROC_EXIT
End Function
Mustaphi, you need to use the unicode API for writing and reading INI.
Update released.
It concerns the drop-down in the DTPicker control, though only on comctl version 5.8x and 6.0. Vista+ not affected (>= 6.1)
The bug was that the drop-down does not show at all when having some of the Calendar* properties not at default setting. (e.g. CalendarShowWeekNumbers = True)
The actual bug was a stupidity. The red marked element was missing and has now been added.
It resulted in the WndRect struct not properly set and thus sizing the drop-down to zeros.Code:SendMessage CalendarHandle, MCM_GETMINREQRECT, 0, ByVal VarPtr(WndRect)
What was strange though that this bug only affected the OCX version. The Std-EXE version did work.. curious.
And btw that was also the reason it did not come to my attention before. :)
However, it was fixed now in both versions of course.
VBCCR15 v1.5.20 (side by side)
some users got the following error message box when starting my app under windows 10:
This error message displays 2 more times after clicking the OK button.Code:VBCCR15
Run-time-error ´429´
ActiveX component can´t create object
after that the app shows "Run-time-error ´440 Automation error" and the app GUI never displays.
Any ideas how to fix or debug this problem?
Does anyone know what kind of objects will be created by VBCCR15 ?
Maybe it is some kind of a dependency problem?
BTW: i cant reproduce this problem by myself using win10...
Update released.
AutoSelect property included in the ComboBoxW control.
It mimics certainly the auto-selecting feature of the combo box in the font common dialog box. (as example)
Attachment 159755
Update released.
New common control 'FontCombo' included. Demo usage has been implemented into the RichTextBoxForm.
Hi, Good work !
I always use a VM with winXP to VB6 . This code need a COMCTL32.dll V6. But my VM have the 5.82 version. If I copy the v6.10 (from my win10) XP, XP refuses because it is used. Any idea ? Thx
The time span get's longer for any next OCX major release as they are not so more new features.
However, I will look forward to bundle in Q3 or latest in Q4 2018.
A few more words about the new FontCombo control:
The FontCombo is actually a clon of the ComboBoxW control, but trimmed down to it's essential features and needs.
It's also trimmed to a 'read-only' control. Means no .AddItem or changing .List() property.
Also at initial the control is setup with style 2 - FtcStyleDropDownList instead of 0 - FtcStyleDropDownCombo.
And the AutoSelect property is by default set to True. (meaningful for style other than 2 -FtcStyleDropDownList)
The core property are the FontPitch and FontType property which determines what kind of fonts are loaded at init.
Just use the .Text property to read and set the selected font name.
Another core feature is the recent list. By default though the RecentMax property is set to 0 - off.
When set higher than 0 the feature is turned on.
Then whenever the user picks a font from the list it is added into the recent list up to RecentMax.
To know the offset to the core list and to know how many items are in the recent list you can read the RecentCount property.
The RecentBackColor/RecentForeColor is intended to visually seperate the recent list from the core list.
ClearRecent method sets the RecentCount to zero and clears the recent list.
SaveRecent/RestoreRecent receives and sets a variant (string) array. By that you can save a recent list to a file or registry.
It's also possible to restore a recent list by hard code:
Code:FontCombo1.RestoreRecent Array("Arial", "MS Sans Serif")
OMG. You can't change the system file.
You can access 5.82 or 6.00 in XP depending if you have an manifest for the app. If you have no clue search around concerning theming and VB6.
You can't use the >=6.10 Vista+ features of comctl32.dll in a XP VM.
Why you don't install the VB6 IDE directly on your Win 10?
Just because, I had done it but in the IDE of Visual Studio 6, I had "jerks" when, by example, I move Controls on form etc... :(Quote:
Why you don't install the VB6 IDE directly on your Win 10?
FONTCOMBO
Small problem
This occurs only if the control is set to RecentMax > 0.
Let's say, the last selected font name was "Zürich".
Then it appears at the top of the list.
If we now press 'End' on the keyboard, the list doesn't scroll down to "Zürich".
It stops at the top, the place where "Zürich" ist found in the recents list.
I would expect that 'End' would go down to the list.
---
Otherwise, a very handy control.
Also it is quite fast, even with a lot of installed fonts in Windows.
Really good to have - thank you.
It's not a problem with the control. It's a event problem in connection with the RichTextBox.
The same problem occurs in the Demo.
The reason is that FontCombo1_Click sets the SelFontName of the RichTextBox which on the other hand fires it's own SelChange event and then again sets the Text of the FontCombo.
In order to avoid this circular thing I added in the Demo (RichTextBoxForm.frm) a Freeze boolean flag: (red marked)
Code:Private Sub FontCombo1_Click()
If FontComboFreezeClick = True Then Exit Sub
RichTextBoxFreezeSelChange = True
If FontCombo1.ListIndex > -1 Then RichTextBox1.SelFontName = FontCombo1.Text
RichTextBoxFreezeSelChange = False
End Sub
Private Sub FontCombo1_CloseUp()
RichTextBox1.SetFocus
End Sub
Private Sub RichTextBox1_SelChange(ByVal SelType As Integer, ByVal SelStart As Long, ByVal SelEnd As Long)
If RichTextBoxFreezeSelChange = True Then Exit Sub
If (SelType And RtfSelTypeText) <> 0 Or SelType = RtfSelTypeEmpty Then
FontComboFreezeClick = True
If IsNull(RichTextBox1.SelFontName) Then
FontCombo1.ListIndex = -1
Else
FontCombo1.Text = RichTextBox1.SelFontName
End If
FontComboFreezeClick = False
End If
End Sub
Feature update for the FontCombo control.
The FontCombo control now has a BuddyControl property which can be set to another FontCombo only.
Example:
a Form has FontCombo1 and FontCombo2.
FontCombo1.BuddyControl is set to FontCombo2.
Thus FontCombo1 will display the font names and FontCombo2 will display the font sizes of the selected font of FontCombo1.
If FontCombo1 changes FontCombo2 will be updated. It's all managed within the control so there is no code effort in the app.
FontCombo2 is then internally marked as "buddied" and thus the RecentMax feature is off and also in case the Style is not List only number input is allowed.
The RichTextBoxForm has been extended to demonstrate this new feature.
Krool
thanks for sharing
hi all , does anyone know what is the property ListItemIndices for listview group is used for ?
I was looking for something to act as a summary panel for the listview control and I started playing with methods and properties and I passed by the previous property and I did not know what it is for
yesterday I compiled a program using the ocx, (I didn't use a manifest), the buttons (on the toolbar, the only control on the form) were not flat.
am I missing anything?
Hi Krool,
I mention some time ago I would like to use your VBCCR with a OCX as a forms object that is interfaced via a COM/OLE automation and callbacks to the host for event processing.
I'm happy to say it's working out great using Script BASIC as the host. Here is a thread I have going on the All BASIC Forum
I remember there being two side-by-side files besides the VBCCR15.OCX. Are these still needed and if so how are they added to the project? Everything seems fine without them so far.
John
Seems to work for me.Quote:
Originally Posted by Hosam AL Dein
I am not sure of the platform you are on . But , for visual studio 6 , it is necessary to manifest the IDE itself to see visual effects during design time . Also for the EXE it is necessary to include an external manifest or an embedded resource file with manifest contents .
I think this is the general case except if you are having these settings already done or maybe you are judging the case only within design time (assuming you have a manifested IDE) . Is it the case also for EXEs ?
Is there a way to detect the column index in listview when clicking and item or subitem ? I came up to hit test . Is there any other way implemented in the current listview and I am missing it ? If not , Can it be added ? if I may suggest .
A ColumnHeader has a SubItemIndex function. So even when the ColumnHeader orders are changed it will advise you the correct index for accessing the sub items.
So you can use this to check/compare with subitem index to the corresponding column index.Code:ListView1.ColumnHeaders(Index).SubItemIndex
It seems I could not form my question clearly .
how can I implement this in the event (item_click) . It has no arguments to deal with column headers . I am mainly asking for how to get the index of the column through the click position on a listview item . The code you provided krool requires the index of the column as input while I want it to be retrieved .
To make it more clear , my main goal is :
when the user right-clicks the listview or accurately an item , I need to extract what column this click was over , to get to the text under the mouse whether it was the first item or another subitem .
I am limited to click event , mouse-up and mouse-down events to detect the mouse button since I want "right click" .
Thanks in advance krool .
Add this code to the MainForm:I've adapted the original code from http://vbnet.mvps.org/index.html?cod.../lvhittest.htmCode:''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ©1996-2011 VBnet/Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Add this code to the MainForm:I've adapted the original code from http://vbnet.mvps.org/index.html?cod.../lvhittest.htmCode:''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ©1996-2011 VBnet/Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Edit:
I deleted the original code due to the copyright notice, but you can adapt the code from the link
In the ListView is an in-built FindSubItem function. There you can pass byRef a SubItem index variable.
Thank you for the 21-Sep-2018 enhancement.
The toolbar performance boost is very important for my app.
Script BASIC is an interpreter. The Windows (non-console) version has a resource manifest. If I run the same program using the console version of Script BASIC it looks like Win2K.Quote:
I think this is the general case except if you are having these settings already done or maybe you are judging the case only within design time (assuming you have a manifested IDE) . Is it the case also for EXEs ?
I would like to start using VBCCR in a large existing project. Let's start with the VBCCR ListView for example. The project currently uses both "Microsoft Windows Common Controls 6.0 (SP6)" and "Microsoft Windows Common Controls-2 6.0 (SP6)".
Steps:
1. Download the ComCtlsDemo.zip attachment from the first post.
2. Copy ComCtlsDemo\OLEGuids\OLEGuids.tlb to C:\Windows\system32
3. In the VB6 IDE, open the project, go to Project -> References... -> Browse, select C:\Windows\system32\OLEGuids.tlb , tick "OLE Guid and interface definitions".
What now?
Update released.
Included 'VirtualListItems' that returns a collection of virtual list items.
This is actually a limited/stripped down and mostly read-only version of the normal 'ListItems'. ('ListItems' feature is disabled when VirtualMode is turned on.)
So when migrating a project from non-virtual to virtual this addition will for sure make things easier as you don't need to reference everywhere to the virtual data source. So you can then go here the re-direction of retrieving for example a text in 'VirtualListItems' which then fires the normal GetVirtualItem event.
But most important you can control there some item states. For example the Selected state of an arbitrary index.
Due to 'ListItems' not available for virtual mode list views you had to use some API. Now that's not necessary anymore.
The Item property only accepts an Index As Long. No AddItem because everything remains controlled by the VirtualItemCount property. The Count property here is just for completeness and returns the same as VirtualItemCount.
Attachment 162091
Again: Nothing was changed in the general virtual mode processing. This is just an addition for comfort and ease of migration. And to avoid some extra API work when going the virtual way. Also events like ItemClick will work in virtual mode. For there 'LvwListItem' will work as before even in virtual mode within these events.
For large existing projects I would recommend to use the ActiveX version of VBCCR in a reg-free way.
Doing this way you don't have to load so much components into your large project. Also it is IDE-safe to use ActiveX version.
After that you open each .frm file and replace all occurrences of 'ComctlLib' to 'VBCCR15' for example.
You may also need to replace other stuff, like enum constants or class objects. For example 'ComctlLib.ListItem' will be 'VBCCR15.LvwListItem'.
VBCCR16.OCX released.
Hi krool ,
This issue is under version 1.6 only .
for ComboBoxW , If the style is dropdown list and the control got focus , it does not show the focus rectangle over the combobox . This was not the behavior for the previous versions . Is it right or I am missing something ?
this is the first time to know this point . I was using all the previous versions without these functions and it worked a bit fine except some casual crashes in IDE . This maybe the reason for these crashes , I will give it a try and report here .
Before this reply , I was suspicious about the way I upgraded the ocx from 15 to 16 and I was intending to ask about it also .
I have opened all the forms and modules and replaced VBCCR15 with VBCCR16 . Is this the proper way for upgrading from one version to another ?
I am developing a usercontrol which has a textboxw . Should I call setupvisualstyles in the Initialize event as well as the form holding the usercontrol ? If yes , how ? while setupvisualstyles requires a form as a parameter . If no , How are visualstyles properly applied in a usercontrol ?
I am asking this question because I have casual IDE crashes when dealing with the user control which contains a VBCCR textbox . I am suspecting the hwnd and hwndusercontrol and also visual styles functions calling you provided in the previous post .
For focus rectangle , the problem is solved by adding visualstyles and common modules and calling the functions in main and in each form load event . Thanks a lot
COMPILER QUESTION
I have my 'own' VBCCR OCX, made from the original Exe sources + some extensions.
Same structure as with the original OCX version.
The OCX is quite large - no problem so far.
Now I'm tuning my app for performance.
Out of curiosity, I compiled the OCX as P-code.
It is a lot smaller.
And the P-code version has no performance advantage.
I didn't really expect it, but wanted to try.
Also it is not slower.
Can it harm somehow to have the OCX as P-code?
Thank you.
I followed the info you provided krool , and the problem is solved . But I encounter casual crashes in IDE in the forms that contain a usercontrol which has a VBCCR textbox . I am wondering if this point could be a reason of theses crashes ?
and what about the proper way for upgrading ?
Krool,
I am looking at VBCCR16 in the Object Browser and I do not see SetupVisualStyles or InitVisualStyles as procedures I can call. Also, neither of these show up anywhere in the source code provided with the OCX. I don't mind calling them but I can't find them. Where are they?
Dbl post
......
Look in ComCtlsDemo in first post for VisualStyles.bas
Krool,
You are saying we need to use InitVisualStyles in Procedure Main before showing a form. Okay. How about SetupVisualStyles? It is in VisualStyles.bas in the demo program (no OCX) and it looks like you put it as the first line of code in each of the forms. However, it is not present in the OCX version so do we assume that it got called internally in your OCX for each form or that is isn't needed or something else. if we should call it in the Form_Load procedure, do we nneed to put SetupVisualStyles into a different module or use VisualStyles.bas?