-
5 Attachment(s)
CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboBox)
What is CheckBoxCombo?
CheckBoxCombo is a general-purpose Multi-select ComboBox User Control designed for Visual Basic. It differs from the conventional ComboBox behavior by allowing user to select one or more items from its drop-down list. CheckBoxCombo greately integrates the existing power of standard VB controls (ComboBox and ListBox) to provide its powerful features and can be easily integrated into any sort of Windows GUI project in VB. Sure, it's a must to have companion in your standard VB Toolbox.
Why is CheckBoxCombo?
The conventional ComboBox control in VB allows you to select only one item at a time from its drop-down list. It cannot be used in situations where you need to select more than one item at a time. For this particular purpose you should use a multi-choice enabled ListBox, which is all right, if you have enough space on your interface/form. But what if you have a very limited space to place the ListBox with dozens of items; may be closer to the bottom of your interface? CheckBoxCombo is a great replacement in such situations where you need to save the space on your UI (User Interface), with its great dynamic features.
CheckBoxCombo is also elegant in providing multiple inputs to SQL queries in database programming.
Further, CheckBoxCombo allows you to set any of its properties even at run-time, which is not even allowed by the traditional ComboBox control. One such property is [sorted], which you can dynamically set the sorting at run-time. This gives you a great flexibility in using the user control simply by overriding the design-time settings as you wish. CheckBoxCombo also exposes some methods to support less coding when working with it.
Its [OnListSearch] property helps user to search and select any item in the list easily.
The user control greatly supports for modern visual styles since it integrates the existing VB controls which support visual styles.
The ActiveX version of CheckBoxCombo is fully compatible even with VBA, if you need to use CheckBoxCombo with Microsoft Office (32-bit) as well.
With CheckBoxCombo's professional features and familiarity in use due to nearly familiar syntax it provides, you will more feel it like a must to have control in your standard VB Toolbox.
Outstanding features of CheckBoxCombo:
- Professional, effective and ready-to-use design for any sort of Windows GUI project in VB
- No dependent modules, extremely easy to integrate as a single module
- Extremely easy to use
- Ability to setup all supported properties even at run-time
- Very smooth and faster operation, even with thousands of items
- Dynamic sorting on ascending or descending, supporting thousands of items
- Supports for different longest-text-display modes
- Search-and-select feature for items
- Exposes methods to support less coding
- Highly flexible and configurable
- Powerful and reliable on all supported operations
- User friendly and familiar syntax
- Supports for all flavors of Windows from Windows XP with visual styles
- Full ActiveX compatibility with VBA (Microsoft Office 32-bit)
- And more...
Note: Please go through the User Documentation and study the Demo Applications attached herewith, so that you may get a clear idea about CheckBoxCombo.
Comments, suggestions are greatly welcome...
Version History:
Code:
Revision update 1.4.1 (24-11-2019)
--------------------------------
• Fixed a minor bug in list search.
CheckBoxCombo 1.4 (03-08-2018)
------------------------------
• Newly introduced <FillListByRecordset> method.
Now, CheckBoxCombo can be directly populated from a Database
with multiple options for greater flexibility
• Added missing property, [NewItem]
• Changed <ItemData, SelItem, SelItemData, SelIndex, SelCount>
methods as properties
• Introduced an optional parameter of type Boolean,
{DelimiterConcatIncluded} to be used with the read-only properties of
[SelItem, SelItemData, SelIndex, Text]. Now, the values of them can be
returned excluding the DelimiterConcat character used with the
[DelimiterConcat] property
• Introduced an additional option {None} with the [DelimiterConcat]
property
• Altered <FillList> method as <FillListByArray>
• Fixed several minor bugs
• Updated User Documentation
• Released database demonstration application
Revision update 1.3.3 (23-07-2018)
----------------------------------
• Fixed a minor bug when displaying the drop-down list
(Translucent rectangle appearance issue on the screen
due to some visual-effect settings of the OS)
Revision update 1.3.2 (18-07-2018)
----------------------------------
• Made internal improvements in hooking machanism
• Bugfixes in ActiveX
CheckBoxCombo 1.3 (15-07-2018)
------------------------------
• Made changes to ActiveX version to be fully compatible with VBA.
Now it’s possible to use CheckBoxCombo even in UserForms,
Spreadsheets, Documents, etc. in Microsoft Office 32-bit editions
• Optimized hooking mechanism
• Fixed issues with MDI
• Fixed issues related to Display Monitor
• Fixed issues with mouse-wheel and scrollbars
• Made minor changes to documentation
CheckBoxCombo 1.2 (05-07-2018)
------------------------------
• Included FillList method. Now the list can be filled by
a String/Variant type array
• Fixed the scrollbar issue
• Enhanced the mouse-click support for selecting/unselecting
items in the list. Now mouse-click supports anywhere on the
list item for quick selections
• Fixed several minor bugs and general optimizations were done
• Updated User Documentation
CheckBoxCombo 1.1 (30-06-2018)
------------------------------
• Made syntax changes of AddItem, RemoveItem and FindItem methods
• Introduced DelimiterConact Property
• Introduced CBCUPdate Property
• Introduced CBCUpdateCompleted event
• Revised <Change> event in v1.0 to <ItemCheck>
• Fixed several bugs and some optimizations were done
• Updated User Documentation
CheckBoxCombo 1.0 (26-06-2018)
------------------------------
• The initial version of CheckBoxCombo
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Very nice implementation.
And welcome to VBForums. :)
Elroy
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Thank you for the nice comment. :)
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
I found a bug.
If I select the Select all items checkbox, will select all same item. Example:
SelectedText return:
Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka
Select Count return: 20
Select ItemData return :
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Selected Item Indexes/numbers return:
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-
1 Attachment(s)
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
gibra
I found a bug.
If I select the Select all items checkbox, will select all same item. Example:
SelectedText return:
Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka,Sri Lanka
Select Count return: 20
Select ItemData return :
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Selected Item Indexes/numbers return:
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
gibra,
I tried for this bug on WinXP, Win7 32/64-bit, and Win10 64-bit, but, unfortunately, I couldn't reproduce it. See the attached screenshot on Win10.
-
1 Attachment(s)
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
I too have the same bug as Gibra Win 10 1803 17134.137. Just clicked on 'Select All Items' in the IDE with the following result!
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
OK....It works ok as an exe. However you need to have it work during testing/design!!!
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Steve,
I tried to reproduce the issue in VB IDE (SP6) on Win 10 Pro 64-bit, but no issue found. Anyway, I will further check and re-upload the stuff.
Thanks.
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
PGBSoft
If you are referring to “On Error Resume Next” statements in property settings, yes, most of them should not be. I simply put them at one stage of the development for a particular testing; hence they need to be cleared. Anyway, I will update the code. Thanks for pointing out it, which I had missed.
For your question about Text property setting, the property is not purposely allowed to set, since it is considered to be a read-only property. The reason is simply integrity purpose, because, the user is only allowed to select items from the list, where the selection is updated as the Text. If it is allowed to set this Text externally, it is going to be a problem. Simply, imagine a Dropdown list style of a regular ComboBox; its Text property setting is read-only when the Text to be set is not in the list. However, you can still set the Text here via the DefaultText property, but that is for a different purpose.
Hi PGBSoft,
I thought I'd just jump over here since newbie2 has his thread marked as resolved.
Regarding the "On Error Resume Next", I don't mind them as long as I know what they're for. However, I've also gotten into the habit of "closing" them with "On Error Goto 0" in the same procedure. If you don't do that, you might leave an error number in the Error object. That was illustrated to me by Bonnie West quite some time ago.
Also, I guess I need to do more testing. However, I use a ComboBox as a "Dropdown List" quite often. But, when storing and fetching data from a database, I often use the .Text property to put the last value back into the ComboBox.
In my simpler ComboCheck control, I just do it all in a very similar way. I probably need to "play" more, as I'm sure you have a way to indicate the previously selected value(s) in your control, just not through the .Text property.
Let me outline a bit more of an example. My software is all medical (basically handicapped children). Let's say we're tracking what braces they wear. Some options are AFO, SMO, UCBL, etc. This is one place I use my multi-select combo, in that they may have more than one that they wear for different occasions. This is stored as a semi-colon separated string in the database. When the therapist re-examines the patient's encounter, the list (somehow delimited) should re-appear in the ComboBox.
Take Care,
Elroy
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
Elroy
In my simpler ComboCheck control, I just do it all in a very similar way. I probably need to "play" more, as I'm sure you have a way to indicate the previously selected value(s) in your control, just not through the .Text property.
Let me outline a bit more of an example. My software is all medical (basically handicapped children). Let's say we're tracking what braces they wear. Some options are AFO, SMO, UCBL, etc. This is one place I use my multi-select combo, in that they may have more than one that they wear for different occasions. This is stored as a semi-colon separated string in the database. When the therapist re-examines the patient's encounter, the list (somehow delimited) should re-appear in the ComboBox.
Elroy
Yes, that is pretty easy with CheckBoxCombo. Just get the selected indexes or items with .SelIndex() or .SelItem() methods and save it in the database. When you restore them just call .SelectList(Your saved values in db). Please refer the Documentation. It is always better to save the indexes in the database if you have a fixed list. Please see the below code blocks too.
For getting selected Indexes/Items in the list with CheckBoxCombo
Code:
'Read whatever value you need, Indexes/Items
Dim varIndexes As String: varIndexes = CheckBoxCombo.SelIndex 'get all the selected indexes
Dim varItems as String: varItems = CheckBoxCombo.SelItem 'get all the selected items
'Now store/save whatever value you need, Indexes/Items, may be in your database
For restoring Indexes/Items in the list with CheckBoxCombo
Code:
'Read whatever stored/saved value you need, Indexes/Items, may be from your database
Dim varRestoreIndexes As String: varRestoreIndexes = 'read the previously stored index values
Dim varRestoreItems as String: varRestoreItems = 'read the previously stored items
'Restore whatever value you need, Indexes/Items
CheckBoxCombo.SelectList(varRestoreIndexes) 'restore/select the indexes in the list
CheckBoxCombo.SelectList(varRestoreItems, Item) 'restore/select the items in the list
Hope this is easy as 1 2 3 and saves pretty much of your code, isn't it? :)
Please read the documentation for more information.
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Steve,
I have made some fixes, can you check it now...
Thanks
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Just tested in IDE - All ok now thanks.
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
Steve Grant
Just tested in IDE - All ok now thanks.
I confirm, too.
Good work PGBSoft!!!
This is a very usefull control.
A control that was missing, and now there is!
-
1 Attachment(s)
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
there's a common issue for such COMBO control is the hook. I think you can fix.
Try to use mouse fast scroll few times then the Listbox can't hide (EXE demo).
On IDE, try to fast scroll by roller, there's a "guo guo" sound" but can hide sometime,sometime can't.
-
Re: CheckBoxCombo 1.1 (A professional, effective and ready-to-use Multi-select ComboB
Jonney,
I suppose the root issue might be related to the input speed in foreground window, which leads hook procedure to time out and hook is silently removed. I will look into this. Thanks.
-
Re: CheckBoxCombo 1.2 (A professional, effective and ready-to-use Multi-select ComboB
CheckBoxCombo 1.2 Released (05-07-2018)
- Included FillList method. Now the list can be filled by a String/Variant type array
- Fixed the scrollbar issue
- Enhanced the mouse-click support for selecting/unselecting items in the list. Now mouse-click supports anywhere on the list item for quick selections
- Fixed several minor bugs and general optimizations were done
- Updated User Documentation
Note: A must to have stable update.
-
Re: CheckBoxCombo 1.2 (A professional, effective and ready-to-use Multi-select ComboB
After quick testing, the control now appears to be stable and a little faster. Well done, a really nice control.
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
CheckBoxCombo 1.3 Released (15-07-2018)
- Made changes to ActiveX version to be fully compatible with VBA. Now it’s possible to use CheckBoxCombo in UserForms, Spreadsheets, Documents, etc. in Microsoft Office 32-bit editions
- Optimized hooking mechanism
- Fixed issues with MDI
- Fixed issues related to Display Monitor
- Fixed issues with mouse-wheel and scrollbars
- Made minor changes to documentation
Note: A more stable update.
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
fast scrolling still got “guo guo” sound.
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Revision update 1.3.2 Released (18-07-2018)
- Made internal improvements in hooking mechanism
- Bugfixes in ActiveX
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
PGBSoft
Revision update 1.3.2 Released (18-07-2018)
- Made internal improvements in hooking mechanism
- Bugfixes in ActiveX
More stable now. Thanks.
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
PGBSoft
Revision update 1.3.2 Released (18-07-2018)
- Made internal improvements in hooking mechanism
- Bugfixes in ActiveX
Great job. :cool:
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Hi, PGBSoft !
Thanks for the control.
I found the bug (both IDE/compiled, win7): when there is no place to drop down the list it drow up, but under the control a translucent rectangle appears (see screenshot #1).
Furthermore, in such case, if you don't close the list, that rectangle left on the form forever (see screenshot #2).
https://prnt.sc/k9bn3q
https://prnt.sc/k9bn8s
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
Dragokas
I found the bug (both IDE/compiled, win7):
No problem for me (tested EXE, IDE on Windows 10 - 1803) :D
No problem for me (tested EXE on Windows 7 SP1)
On Windows 7 SP1 IDE, the translucent rectangle appears for a moment, but then disappears when the list is displayed.
:wave:
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Revision update 1.3.3 Released (23-07-2018)
- Fixed a minor bug when displaying the drop-down list (Translucent rectangle appearance issue on the screen due to some visual-effect settings of the OS)
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
Dragokas
I found the bug (both IDE/compiled, win7): when there is no place to drop
down the list it drow up, but under the control a translucent rectangle appears (see screenshot #1).
Furthermore, in such case, if you don't close the list, that rectangle left on the form forever (see screenshot #2).
https://prnt.sc/k9bn3q
https://prnt.sc/k9bn8s
Quote:
Originally Posted by
gibra
On Windows 7 SP1 IDE, the translucent rectangle appears for a moment, but then disappears when the list is displayed.
Thanks to Dragokas and gibra, this issue has been fixed now with the latest Revision update 1.3.3 (23-07-2018).
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
PGBSoft, confirmed. Good work.
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
Dragokas
PGBSoft, confirmed. Good work.
I agree 100%, for version 1.3.3 too.
However, seem that ItemData property can't be set by code. Example:
Code:
With cboUser
.Clear
.AddItem "MyItem"
.ItemData(.NewIndex) = rs!IDUser
End With
Why?
ItemData seem to be a Method read-only, instead of Property as with standard VB.ComboBox and also third-party comboboxes.
This creates a problem when we use your CheckBoxCombo control with pre-existing routines that populate the comboboxes.
Compatibility is completely lost.
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
gibra
However, seem that
ItemData property can't be set by code. Example:
Code:
With cboUser
.Clear
.AddItem "MyItem"
.ItemData(.NewIndex) = rs!IDUser
End With
Why?
ItemData seem to be a Method read-only, instead of Property as with standard VB.ComboBox and also third-party comboboxes.
This creates a problem when we use your CheckBoxCombo control with
pre-existing routines that populate the comboboxes.
Compatibility is completely lost.
Hi gibra,
Actually, the method, ItemData can be used for both Read/Write to ItemData, but its implementation is slightly different from a typical ComboBox.
Code:
Dim var As Long: var = CheckBoxCombo.ItemData(1) 'gets the ItemData value at Index 1
CheckBoxCombo.ItemData 5, 6 'sets the ItemData value as 6 at the index 5
Unfortunately the NewIndex property is currently missing.
I will surely address them in the next update.
Thank you.
_____________________
PGBSoft
-
A bug
The SelItemData and SelText properties contains strange ASCII control character (28, FileSeparator)
(see https://theasciicode.com.ar/ table)
To reproduce issue in the original project add this code to form:
After run the project add in combo countries:
Sri Lanka,Zambia,Jamaica
Code:
Private Sub txtSelectedItemData_Click()
Dim i As Long
Dim SelItems As String
SelItems = CheckBoxCombo1.SelItemData
For i = 1 To Len(SelItems)
Debug.Print i, Chr$(Asc(Mid$(SelItems, i, 1))), Asc(Mid$(SelItems, i, 1))
Next i
End Sub
Click on txtSelectedItemData and in Immediate windows you see:
Code:
1 1 49
2 , 44
3 28
4 4 52
5 , 44
6 28
7 6 54
Code:
Private Sub txtSelectedText_Click()
Dim i As Long
Dim SelText As String
SelText = CheckBoxCombo1.SelItem
For i = 1 To Len(SelText)
Debug.Print i, Chr$(Asc(Mid$(SelText, i, 1))), Asc(Mid$(SelText, i, 1))
Next i
End Sub
Click on txtSelectedText and in Immediate windows you see:
Code:
1 S 83
2 r 114
3 i 105
4 32
5 L 76
6 a 97
7 n 110
8 k 107
9 a 97
10 , 44
11 28
12 Z 90
13 a 97
14 m 109
15 b 98
16 i 105
17 a 97
18 , 44
19 28
20 J 74
21 a 97
22 m 109
23 a 97
24 i 105
25 c 99
26 a 97
So, if we try to use the SelItemData value with IN operator in a query, i.e. :
Code:
SELECT * FROM MyTable WHERE ID IN (" & CheckBoxCombo1 & ")"
We get a sintax error.
EDIT: seem the same problem for txtSelectedIndexes...
EDIT2: to solve this issue we have to re-elaborate the property. Example:
Code:
Dim SelItems As String
Dim newSelItmes As String
SelItems = cbo.SelItemData
newSelItems = vbNullString
If SelItems > vbNullString Then
For i = 1 To Len(SelItems)
If Mid$(SelItems, i, 1) <> vbNullString Then
If Asc(Mid$(SelItems, i, 1)) <> 28 Then
'Debug.Print i, Chr$(Asc(Mid$(SelItems, i, 1))), Asc(Mid$(SelItems, i, 1))
newSelItems = newSelItems & Chr$(Asc(Mid$(SelItems, i, 1)))
End If
End If
Next i
Debug.Print newSelItems
End If
-
Re: A bug
Quote:
Originally Posted by
gibra
The SelItemData and SelText properties contains strange ASCII control character (28, FileSeparator)
(see
https://theasciicode.com.ar/ table)
To reproduce issue in the original project add this code to form:
After run the project add in combo countries:
Sri Lanka,Zambia,Jamaica
Code:
Private Sub txtSelectedItemData_Click()
Dim i As Long
Dim SelItems As String
SelItems = CheckBoxCombo1.SelItemData
For i = 1 To Len(SelItems)
Debug.Print i, Chr$(Asc(Mid$(SelItems, i, 1))), Asc(Mid$(SelItems, i, 1))
Next i
End Sub
Click on txtSelectedItemData and in Immediate windows you see:
Code:
1 1 49
2 , 44
3 28
4 4 52
5 , 44
6 28
7 6 54
Code:
Private Sub txtSelectedText_Click()
Dim i As Long
Dim SelText As String
SelText = CheckBoxCombo1.SelItem
For i = 1 To Len(SelText)
Debug.Print i, Chr$(Asc(Mid$(SelText, i, 1))), Asc(Mid$(SelText, i, 1))
Next i
End Sub
Click on txtSelectedText and in Immediate windows you see:
Code:
1 S 83
2 r 114
3 i 105
4 32
5 L 76
6 a 97
7 n 110
8 k 107
9 a 97
10 , 44
11 28
12 Z 90
13 a 97
14 m 109
15 b 98
16 i 105
17 a 97
18 , 44
19 28
20 J 74
21 a 97
22 m 109
23 a 97
24 i 105
25 c 99
26 a 97
So, if we try to use the SelItemData value with IN operator in a query, i.e. :
Code:
SELECT * FROM MyTable WHERE ID IN (" & CheckBoxCombo1 & ")"
We get a sintax error.
EDIT: seem the same problem for txtSelectedIndexes...
Hi gibra,
Actually this behavior is by design with the introduction of DelimiterConcat property based on non-printing ASCII Characters. (Please See the documentation.). However, I will try to change its default to none.
As a workaround for SQL issue, Try to use
Code:
SELECT * FROM MyTable WHERE ID IN (" & Replace(CheckBoxCombo1.SelItem, CheckBoxCombo1.Delimiter, ",") & ")"
-
Re: A bug
Quote:
Originally Posted by
PGBSoft
As a workaround for SQL issue, Try to use
Code:
SELECT * FROM MyTable WHERE ID IN (" & Replace(CheckBoxCombo1.SelItem, CheckBoxCombo1.Delimiter, ",") & ")"
Thank. I will try.
However, the documentation about Delimiter says:
Quote:
The Delimiter is a Get/Set property basically used as a seperator for the selected items in the drop-down list. You can set any character or combination, which is easy to read (Eg: |;~) without worrying about delimiter collision. The default is "," (Comma).
Note:If you wish, you may keep the Delimiter blank, which is still handled by the DelimiterConcat, but never recommended.
While about DelimiterConcat says:
Quote:
The DelimiterConcat is a newly introduced property to avoid delimiter collision. Now the delimiter you set, is internally concatenated with a non-printing ASCII character used as an Information Seperator, based on four options, [Chr(28) - File separator, Chr(29) - Group separator, Chr(30) - Record separator, Chr(31) - Unit separator]. The property is a Get/Set property with the default of "Chr(28) - File separator".
So if is internally concatenated I'm inclined to think that I do not have to worry about which internal delimiter is used, but only that the Delimiter is the default one, that is the comma.
Perhaps (i think) it would be useful if there were also other properties that simply return the values delimited by the Delimiter, which do not contain the DelimiterConcat character.
As seen in textboxes, where it is impossible to understand that there is a second delimiter. In fact this had misled me
-
Re: A bug
Sorry for the misleading stuff...
Quote:
Originally Posted by
gibra
So if is internally concatenated I'm inclined to think that I do not have to worry about which internal delimiter is used, but only that the Delimiter is the default one, that is the comma.
However, when working with the code, you can simply get the delimiter by CheckBoxCombo.Delimiter property (which is actually concatenated with the DelimiterConcat character), which can be simply used for the operations of splitting, replacing, ect. on SelItem, SelItemData and SelIndex values. This is actually done for the prevention of delimiter collision.
Quote:
Originally Posted by
gibra
Perhaps (i think) it would be useful if there were also other properties that simply return the values delimited by the Delimiter, which do not contain the DelimiterConcat character.
Good Idea!, I will introduce an optional parameter to be used with SelItem, SelItemData and SelIndex properties, and an additional option, [None] to the DelimiterConcat property setting for more flexibility. :)
-
Re: CheckBoxCombo 1.3 (A professional, effective and ready-to-use Multi-select ComboB
Problem using - arr = Split (CheckBoxCombo.SelItem, ",")
I fill the array with the selected items in the list. After, I use an array to insert the data in the query string to the database. The query consistently returned an incomplete set of data, and I did not understand why.
But one day, by copying a query string into a text editor, I found the hidden characters in the string. These hidden symbols were the symbols DelimiterConcat
Here is part of the query string ... 3-1, 3-3, 3-4 are data from the array (arr)
"(SRSKV.SKV)='3-1' OR (SRSKV.SKV)='FS3-3' OR (SRSKV.SKV)='FS3-4'" ...... FS - hidden symbols.
How can I get rid of these hidden symbols?
p.s Sorry did not notice Replace(CheckBoxCombo1.SelItem, CheckBoxCombo1.Delimiter, ",").... It works
-
4 Attachment(s)
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
CheckBoxCombo 1.4 Released (03-08-2018)
- Newly introduced <FillListByRecordset> method. Now, CheckBoxCombo can be directly populated from a Database with multiple options for greater flexibility
- Added missing property, [NewItem]
- Changed <ItemData, SelItem, SelItemData, SelIndex, SelCount> methods as properties
- Introduced an optional parameter of type Boolean, {DelimiterConcatIncluded} to be used with the read-only properties of [SelItem, SelItemData, SelIndex, Text]. Now, the values of them can be returned excluding the DelimiterConcat character used with the [DelimiterConcat] property
- Introduced an additional option {None} with the [DelimiterConcat] property
- Altered <FillList> method as <FillListByArray>
- Fixed several minor bugs
- Updated User Documentation
- Released database demonstration application
Note: A must to have minor update. (more stable and flexible)
Click here to download
>>Interfaces of database demo application:>>
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
The Recordset sample doesn't work as expected when language isn't english.
This becuase the Selected property return a boolean value translated on current language.
Example, in Italian, Falso or Vero are returned by propperty, instead of False or True.
Because of this the query value in Private Sub CheckBoxCombo1_ItemCheck(Item As Integer) become:
Code:
UPDATE CountryList SET CheckedState = Vero WHERE ID = 1
or
Code:
UPDATE CountryList SET CheckedState = Falso WHERE ID = 1
Therefore nothing will updated on table CountryList on my system (italian).
But the use of this values maybe good when you work with Access databases only, that recognize False and True as boolean values, but only is they are on english language.
Also, in SQL Server the related data type of Boolean is Bit (0/1) so should be good if the Selected return 0 or 1, instead of False or True.
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
gibra
The Recordset sample doesn't work as expected when language isn't english.
This becuase the Selected property return a boolean value
translated on current language.
Example, in
Italian, Falso or Vero are returned by propperty, instead of False or True.
Because of this the
query value in Private Sub CheckBoxCombo1_ItemCheck(Item As Integer) become:
Code:
UPDATE CountryList SET CheckedState = Vero WHERE ID = 1
or
Code:
UPDATE CountryList SET CheckedState = Falso WHERE ID = 1
Therefore
nothing will updated on table
CountryList on my system (
italian).
But the use of this values maybe good when you work with Access databases only, that recognize False and True as boolean values, but only is they are on english language.
Also, in SQL Server the related data type of Boolean is
Bit (0/1) so should be good if the
Selected return
0 or
1, instead of False or True.
Hi gibra,
The database demo was simply designed to show typical examples with some of CheckBoxCombo's possibilities, where you can do your own-customization as you wish.
The [CheckedState] field in CountryList table does not necessary to be a Boolean type; it may be a Type of Number, int, Text, varchar, ect. with an appropriate value of [1 or 0] OR ["1" or "0"] OR ["True" or "False"] OR ["Vero" or "Falso" - (if your language is Italian OR such with other language)] representing the checked state of items. What is needed to be done is to implement the appropriate changes in the query.
So for your language issue, try to use something like as follows in CheckBoxCombo1_ItemCheck.
Code:
query = "UPDATE CountryList SET CheckedState = " & IIf(CheckBoxCombo1.Selected(Item) = Vero, True, False) & " WHERE ID = " & CheckBoxCombo1.ItemData(Item)
OR
Code:
query = "UPDATE CountryList SET CheckedState = " & IIf(CheckBoxCombo1.Selected(Item) = Vero, 1, 0) & " WHERE ID = " & CheckBoxCombo1.ItemData(Item)
Further, FillListByRecordset method of CheckBoxCombo is flexible enough to use with its different options as per your requirement. (In order to use FillListByRecordset method, the minimum requirement is, you should have only one field in a table representing its DisplayMember parameter, which is for populating items in CheckBoxCombo.)
Thank you.
______________
PGBSoft
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Everything you've explained is now known for decades. Thanks.
I see instead that you did not understand my observation.
The problem is neither the database, nor the table, nor the type of field.
The problem is that the Selected property returns a value translated into the current language, this does not have to happen.
Moreover, False and True are not valid values for any database.
To be truly usable by everyone, in any language, it should return a standard value, such as 0/1 or 0/-1 or False/True.
Anyway, it does not matter, I will go to modify the source code of your user control.
Thanks anyway for the excellent work.
P.S.
When you reply, pay attention to do not overquoting, please, it's useless and annoying.
Overquoting: https://en.wikipedia.org/wiki/Wikipedia:Overquoting
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Thank you for the feedback.
Quote:
Originally Posted by
gibra
The problem is neither the database, nor the table, nor the type of field.
The problem is that the Selected property returns a value translated into the current language, this does not have to happen.
Moreover, False and True are not valid values for any database.
To be truly usable by everyone, in any language, it should return a standard value, such as 0/1 or 0/-1 or False/True.
Well, but I don't think this behavior is needed for most of the cases. As far as I know, the return type of the Selected property of a standard control such as ListBox is Boolean by design leading the control to be used easily with less compatibility issues. Since there are many workarounds to solve the type of issues addressed, I don't think changing the standard behavior of a property is much needed.
Eg:
Code:
query = "UPDATE CountryList SET CheckedState = " & CInt(CheckBoxCombo1.Selected(Item)) & " WHERE ID = " & CheckBoxCombo1.ItemData(Item)
-
1 Attachment(s)
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Version 1.4 - there was a problem.
Registration is done by the administrator.
Attachment 160881
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
bormman
Version 1.4 - there was a problem.
Registration is done by the administrator.
Attachment 160881
Hope you have successfully registered CheckBoxCombo 1.4.
The reason might be because, you might have used an older version of CheckBoxCombo with Excel previously.
Then, try following the below steps.
1. Just go to your profile AppData Folder (Eg: "C:\Users\[your_profile_name]\AppData")
2. In AppData folder, search for EXD files (*.exd).
3. Then delete all CheckBoxCombo_ActiveX.exd files you find.
4. Now try inserting the control again in Excel.
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
PGBSoft
Hope you have successfully registered CheckBoxCombo 1.4.
The reason might be because, you might have used an older version of CheckBoxCombo with Excel previously.
Then, try following the below steps.
I did, but it does not help. The error is the same.
-
1 Attachment(s)
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
bormman
I did, but it does not help. The error is the same.
If so, the problem might be related to the security and privacy settings for the ActiveX controls of your Office package. Let's try the following steps.
1. First you unregister the CheckBoxCombo.ocx and register it again with administrative privileges.
To unregister, use: regsvr32 -u CheckBoxCombo.ocx 'assume you are in the command prompt, where the CheckBoxCombo.ocx exists.
To register, use: regsvr32 CheckBoxCombo.ocx 'assume you are in the command prompt, where the latest CheckBoxCombo.ocx exists.
Note: It is better you always maintain one location to keep the ocx file (such as "C:\Windows\System32" (32-bit OS) or "C:\Windows\SysWOW64" (64-bit OS)).
2. Then, open Excel and go to:
File > Excel Options > Trust Center > Trust Center Settings... > ActiveX Settings and make the changes as in the following screensthot or as per your requirement (without selecting the first option).
Attachment 160887
3. Then, try to insert the control again in Excel.
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
PGBSoft
If so, the problem might be related to the security and privacy settings for the ActiveX controls of your Office package. Let's try the following steps......
All of these steps I have already done, moreover, I deleted all the records associated with CheckBoxCombo ..... from the registry. Then, once again, I Unregister and Registered the component ..... nothing helps. Error is the same.
CheckBoxCombo.ocx does not work only in Excel, in VB6 works perfectly.
Strange situation...
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
bormman
CheckBoxCombo.ocx does not work only in Excel, in VB6 works perfectly.
Strange situation...
Hmm.., strange..., Unfortunately, I can't reproduce this problem.
- Can you add the control to UserForms within Excel?
- Can you add the control in other office applications like Word, Access, etc.?
- What version of Office package you are using?
Just go to the following Microsoft support pages and see their instructions/updates apply for you.
P.S. Have you tried inserting CheckBoxCombo 1.3 to Excel worksheet previously with success results?
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
- Can you add the control to UserForms within Excel?................................................................................... YES
- Can you add the control in other office applications like Word, Access, etc.?.................................................. YES
- What version of Office package you are using?.......................................................................................... Office 2016 Pro+
- Have you tried inserting CheckBoxCombo 1.3 to Excel worksheet previously with success results?................... YES
The problem was solved as follows:
Delete TEMP *.exd file if necessary. (link General) In the sub-folders Excel8.0 and VBE folder Temp was a 2 CheckBoxCombo_ActiveX.exd files (my Temp folder is not on the system disk.)
PGBSoft Thank you.
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Awesome control PGBSoft ,
When I set the Onlistsearch property to true and opening the list by mouse it auto-closes itself , while this is not the behavior when opening the list by arrow or f4
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Thanks Hosam. That issue had been reported and I have already made a fix. I will update the CodeBank.
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Revision update 1.4.1 Released (24-11-2019)
- Fixed a minor bug in list search.
Download the latest here.
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Will there be updates for this ActiveX?
Excel 2021 and 2024 are experiencing crashes.
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
bormman
Will there be updates for this ActiveX?
Excel 2021 and 2024 are experiencing crashes.
There is source code included so that everyone can fix whatever issues they face -- that's the magic of OSS and everyone is invited to contribute.
I wouldn't be surprised if OP moved to JavaScript or other green field development long time ago so you can either fix issues yourself or continue waiting which is not very productive. . .
cheers,
</wqw>
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
wqweto
Are you a WinApi expert? I'm not.
If the problem were occurring in VB6, it would be possible to catch the error during debugging, but the error (stack overflow) occurs in Excel VBA.
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
bormman
wqweto
Are you a WinApi expert? I'm not.
If the problem were occurring in VB6, it would be possible to catch the error during debugging, but the error (stack overflow) occurs in Excel VBA.
Well, happens to professional, effective and ready-to-use Multi-select ComboBoxes all the time. . .
cheers,
</wqw>
-
Re: CheckBoxCombo 1.4 (A professional, effective and ready-to-use Multi-select ComboB
Quote:
Originally Posted by
bormman
wqweto
Are you a WinApi expert? I'm not.
If the problem were occurring in VB6, it would be possible to catch the error during debugging, but the error (stack overflow) occurs in Excel VBA.
You must change the control error, to compile a debug project