|
-
Mar 16th, 2021, 03:16 PM
#3081
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Thanks for the quick reply.
I noticed that with the original toolbar, the space above and below the buttons is the same, whereas with the CCR toolbar the buttons are aligned with the bottom of the "bar". See picture below.
Attachment 180614
Then, for some reason I haven't yet figured out, the scaling of other controls on the main screen didn't happen correctly, resulting in the bottom of the CCR being "cut off", which made it look rather strange:
Attachment 180615
However, when I force the resize again, the scaling is done corectly, and the CCR toolbar looks a lot better.
I'd still prefer the look with as much padding below as above, but that's clearly no showstopper.
Regards,
Erwin
-
Mar 16th, 2021, 04:06 PM
#3082
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
Would it be possible to share some sample code on how you populate the imagelist, and assign the images to the toolbar buttons? (Or do you "preset" the button Image index?)
Sure, if you can wait until next week - I don't have access right now.
It's really no magic.
-
Mar 17th, 2021, 01:03 AM
#3083
Re: CommonControls (Replacement of the MS common controls)
Erwin69,
I can't view the images in your post.
-
Mar 17th, 2021, 04:09 AM
#3084
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
Erwin69,
I can't view the images in your post.
Let's try again:

-
Mar 17th, 2021, 01:54 PM
#3085
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Erwin
For me it was too cumbersome to maintain the toolbar manually.
Therefore I do it all by code.
If you have a few buttons only, then it is perhaps too much effort.
You need to use the VBCCR imagelist.
Fill it from external DLL, or use LaVolpes image library.
Or use BMP32 and load the images from files.
Many possibilities.
In my case an external DLL was wanted.
First fill the imagelist(s) on app start:
Code:
Private Sub InitIconsToolbars()
Dim i As VBCCR.ImageList
Dim R As New c_ResFromDLL
'--------------------------------------------------
R.LibraryFilePath = App.Path & "\RES.dll"
Set i = MF.imgl_Toolbars
StartGDIPlus
i.ListImages.Clear
i.ColorDepth = ImlColorDepth32Bit
i.ImageWidth = 0
i.ImageHeight = 0
ResDLLToImgl i, R, "new"
ResDLLToImgl i, R, "open"
'and 100's more
Set i = Nothing
StopGDIPlus
R.CloseLibrary
Set R = Nothing
End Sub
Filling a toolbar:
Code:
Set IL = MF.imgl_Toolbars
ToolbarBackColor = vbWhite
With tbr_Main
.AllowCustomize = False
.BackColor = ToolbarBackColor
.Buttons.Clear
Set .ImageList = IL
.Divider = False
.ShowTips = True
.DoubleBuffer = True
.Transparent = Not True
.MinButtonWidth = 0
.MaxButtonWidth = 0
Set b = .Buttons.Add(, "new", , TbrButtonStyleDefault, "new")
b.ToolTipText = "New"
Set b = .Buttons.Add(, "open", , TbrButtonStyleDefault, "open")
b.ToolTipText = "Open"
.GetIdealSize WS, HS
.Width = WS
.Height = HS
Set b = Nothing
End With
-
Mar 17th, 2021, 02:44 PM
#3086
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Thanks Karl. I'll need to study this a bit more.
My app has a limited set of buttons, so manually adding these is not the issue. The challenge is more the use of transparency.
I've taken this update as an opportunity to "modernize" the toolbar look and feel. As part of the pre-work, I collected/designed/created a series of images that are all saved in PNG-format with transparency. As that format unfortunately isn't supported by the VBCCR imagelist (and not by the original either), I need to figure out what the best approach is.
-
Mar 17th, 2021, 03:48 PM
#3087
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
Let's try again:

Ok. I am just wondering what I should do then. Just add a magic space then ?
-
Mar 17th, 2021, 03:53 PM
#3088
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
Ok. I am just wondering what I should do then. Just add a magic space then ?
Unless it's simple, and you feel that it improves the look and feel of the CCR Toolbar, I wouldn't do anything.
From my point of view it would be a small cosmic improvement that would be nice to have, but most definitely not a showstopper or worth a significant amount of effort.
-
Mar 17th, 2021, 05:42 PM
#3089
Lively Member
Re: CommonControls (Replacement of the MS common controls)
Karl
could you please elaborate on lines of code you entered
Code:
Dim R As New c_ResFromDLL
'--------------------------------------------------
R.LibraryFilePath = App.Path & "\RES.dll"
Set i = MF.imgl_Toolbars
StartGDIPlus
i.ListImages.Clear
i.ColorDepth = ImlColorDepth32Bit
i.ImageWidth = 0
i.ImageHeight = 0
ResDLLToImgl i, R, "new"
ResDLLToImgl i, R, "open"
'and 100's more
Set i = Nothing
StopGDIPlus
R.CloseLibrary
Set R = Nothing
could you please point me to a link where i can get this class c_ResFromDLL, it would be quite helpful for me.
also the GDIPlus Library
thanks
-
Mar 18th, 2021, 01:35 AM
#3090
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Here's the DLL and PNG stuff.
It is quite old and probably there are more elegant solutions.
Also it is a adjusted to my needs.
PNG_etc.zip
I think #3089 is answered when you inspect the libs.
Last edited by Karl77; Mar 18th, 2021 at 01:40 AM.
-
Mar 18th, 2021, 08:53 AM
#3091
Lively Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
Here's the DLL and PNG stuff.
It is quite old and probably there are more elegant solutions.
Also it is a adjusted to my needs.
PNG_etc.zip
I think #3089 is answered when you inspect the libs.
Thanks, I am making good use out of it, and saved a lot of time by not doing it myself
-
Mar 21st, 2021, 02:01 PM
#3092
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
Unless it's simple, and you feel that it improves the look and feel of the CCR Toolbar, I wouldn't do anything.
From my point of view it would be a small cosmic improvement that would be nice to have, but most definitely not a showstopper or worth a significant amount of effort.
I would like to help you.. it's just that in this case I have not the answer..
-
Mar 23rd, 2021, 05:11 PM
#3093
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool, don't worry about the extra space below the buttons. As said, it's a small cosmic improvement not worth a lot of trouble. Rest assured that your help is greatly appreciated either way!
However, something is puzzling me with the Toolbar.
The layout of my main screen is a menu-bar and the toolbar on top, and a statusbar at the bottom. In between there is a picturebox that serves as a "container" for a range of other controls.
I assigned 32x32 pixel images to the toolbar buttons using a CCR imagelist, giving the toolbar a Height of 630. This is what I see in the IDE, and what is saved in the frm-file. However, at application startup, the size is reported as 390, which messes up the resizing and positioning of the container and the items in it. After the form-resize event, it actually correctly reports the height of 630 for the toolbar, so I've moved some code around to do the resizing of the other controls at a later stage. Which works fine.
But, now I have the strange thing that the container part of the screen is not painted after the resize and reposition. Only when I move the mouse over the toolbar, or over the statusbar at the bottom, the center of the screen is "refreshed" and properly painted. This happens when the app is run from the IDE as well as compiled.
I realize that this is vague, and for sure don't claim it's related to the CCR toolbar, but I've been killing myself for many hours in the last several days to figure out what is causing this, and still have no clue. Hopefully the description rings a bell for someone to point me in the right direction.
-
Mar 24th, 2021, 12:44 AM
#3094
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
Hi Krool, don't worry about the extra space below the buttons. As said, it's a small cosmic improvement not worth a lot of trouble. Rest assured that your help is greatly appreciated either way!
However, something is puzzling me with the Toolbar.
The layout of my main screen is a menu-bar and the toolbar on top, and a statusbar at the bottom. In between there is a picturebox that serves as a "container" for a range of other controls.
I assigned 32x32 pixel images to the toolbar buttons using a CCR imagelist, giving the toolbar a Height of 630. This is what I see in the IDE, and what is saved in the frm-file. However, at application startup, the size is reported as 390, which messes up the resizing and positioning of the container and the items in it. After the form-resize event, it actually correctly reports the height of 630 for the toolbar, so I've moved some code around to do the resizing of the other controls at a later stage. Which works fine.
But, now I have the strange thing that the container part of the screen is not painted after the resize and reposition. Only when I move the mouse over the toolbar, or over the statusbar at the bottom, the center of the screen is "refreshed" and properly painted. This happens when the app is run from the IDE as well as compiled.
I realize that this is vague, and for sure don't claim it's related to the CCR toolbar, but I've been killing myself for many hours in the last several days to figure out what is causing this, and still have no clue. Hopefully the description rings a bell for someone to point me in the right direction.
It's the ImageList. Once without (390) and then with (630).
This is a dilemma by design. The ImageList property is saved as string in the CCR ToolBar.
I cannot lookup the ImageList Object during UserControl_ReadProperties as the order in which VB loads the control cannot be influenced.
So doing the lookup in UserControl_ReadProperties would be a luck game. Can work or not.
That's why an inteenal VB.Timer is used for that (only when needed, for ImageList) and it is ensured to fire when everything is safe. However that is AFTER the Form_Load event.
You can FIX this dilemma actually by code in Form_Load:
Code:
Set ToolBar1.ImageList = ToolBar1.ImageList ' Force internal lookup now
-
Mar 24th, 2021, 02:50 AM
#3095
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
I use a pager for every toolbar.
This works very well and is only visible when the form is too small to show the full toolbar.
I set the buddy by code, because in the IDE it doesn't work so good.
The toolbar size is correct when I use this after populating the toolbar:
Code:
.GetIdealSize WS, HS
.Width = WS
.Height = HS
On positioning the toolbar without a pager, I don't care about the toolbar height.
I use the first button as the reference.
This way extra space below the buttons doesn't hurt.
-
Mar 24th, 2021, 03:54 PM
#3096
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
It's the ImageList. Once without (390) and then with (630).
This is a dilemma by design. The ImageList property is saved as string in the CCR ToolBar.
I cannot lookup the ImageList Object during UserControl_ReadProperties as the order in which VB loads the control cannot be influenced.
So doing the lookup in UserControl_ReadProperties would be a luck game. Can work or not.
That's why an inteenal VB.Timer is used for that (only when needed, for ImageList) and it is ensured to fire when everything is safe. However that is AFTER the Form_Load event.
You can FIX this dilemma actually by code in Form_Load:
Code:
Set ToolBar1.ImageList = ToolBar1.ImageList ' Force internal lookup now
Thanks Krool. That fixed it, and it did also help me to find the solution for the other problem.
-
Mar 26th, 2021, 12:01 PM
#3097
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Yet another question on the toolbar...
I've added image lists for the active buttons, and for disabled buttons. I have a separate routine that enables/disables menu-items and toolbar buttons depending on availablilty of data.
It runs at app startup, after which a number of the buttons are disabled. Then when load a file, it is run again, to enable the applicable buttons. So far, so good. However, after the routine is run, the toolbar is not repainted until the mouse moves over it. Even the explicit instruction to Refresh doesn't change that behavior.
Is there a setting / instruction that I'm overlooking?
-
Mar 26th, 2021, 04:06 PM
#3098
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
Yet another question on the toolbar...
I've added image lists for the active buttons, and for disabled buttons. I have a separate routine that enables/disables menu-items and toolbar buttons depending on availablilty of data.
It runs at app startup, after which a number of the buttons are disabled. Then when load a file, it is run again, to enable the applicable buttons. So far, so good. However, after the routine is run, the toolbar is not repainted until the mouse moves over it. Even the explicit instruction to Refresh doesn't change that behavior.
Is there a setting / instruction that I'm overlooking?
Can you bundle a small demo showing the problem ? I can't replicate it. Thanks
-
Mar 29th, 2021, 04:19 AM
#3099
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Version 3 of the Documentation and Compile Utility for Krool's controls has been released here.
MountainMan
-
Mar 29th, 2021, 10:11 AM
#3100
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
Can you bundle a small demo showing the problem ? I can't replicate it. Thanks
When I isolated the toolbar as the only control on a separate from, it worked correctly, so there must be something else that has an influence. I will have to investigate further.
-
Apr 2nd, 2021, 05:31 PM
#3101
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
While I’m finetuning the implementation of the VBCCR components in my application, I discovered a significant performance issue in one area.
I’m using the following steps to show the user a combo with only unique values:
1. All items are added to a sorted listview
2. Then go through the listview from the top, removing double items
3. Last, the remaining items are added to the dropdown
Using a 1000 records dataset, these were the results:
- Using a sorted Microsoft Common Controls listview, the process takes 25 milliseconds.
- Using a sorted VBCCR listview, the process takes 21030 milliseconds.
- Using a non-sorted VBCCR listview, filling it, setting sorting to true, and then do the rest of the process, takes 138 milliseconds.
The first and third approach broken down:
Microsoft ListView
Fill Listview 8 ms
Remove Doubles 14 ms
Fill Combo 3 ms
VBCCR ListView
Fill Listview 28 ms
Switch to sorted 65 ms
Remove Doubles 40 ms
Fill Combo 5 ms
The ListView basically has all properties set to False, except for Enabled, as it's only used behind the scenes, and therefore doesn't need to be displayed, refreshed, etc.
Note: no further action is expected from my side as I can live with the 138 ms, but I thought to share this to show that different approaches can make a massive difference.
-
Apr 2nd, 2021, 06:53 PM
#3102
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
Please Krool help me regarding this point
Tutorial:
The "Development" machine needs to register the VBCCR17.OCX as usual and use the components for e.g. in a Std-EXE project.
The source project needs to include the Side-by-side resources. (see below)
Then on the "End user" machine you only need the VBCCR17.OCX and the .exe (Std-EXE project) on the same folder.
It will work then without any registration.
I followed these steps for VBFlexGrid and everything is working fine on the end user machine.
However I failed to do so with common controls.
I'll tell you about all the steps I did.
I used the Resource Hacker utility to add the VBCCR17SideBySide.res to the VBFLXGRD14SideBySideAndVisualStyles.res
Once they are compiled in one file I added them to the project.
I placed the VBCCR17.OCX and the VBFLXGRD14.OCX in the .exe folder.
I still have no issue with the VBFLXGRD14 but I'm having error with the VBCCR17
“Component 'VBCCR17. OCX' or one of its dependencies not correctly registered: a file is missing or invalid”
On The "Development" machine, I have no issue
Thank you in advance
-
Apr 3rd, 2021, 07:47 AM
#3103
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
While I’m finetuning the implementation of the VBCCR components in my application, I discovered a significant performance issue in one area.
I’m using the following steps to show the user a combo with only unique values:
1. All items are added to a sorted listview
2. Then go through the listview from the top, removing double items
3. Last, the remaining items are added to the dropdown
Using a 1000 records dataset, these were the results:
- Using a sorted Microsoft Common Controls listview, the process takes 25 milliseconds.
- Using a sorted VBCCR listview, the process takes 21030 milliseconds.
- Using a non-sorted VBCCR listview, filling it, setting sorting to true, and then do the rest of the process, takes 138 milliseconds.
The first and third approach broken down:
Microsoft ListView
Fill Listview 8 ms
Remove Doubles 14 ms
Fill Combo 3 ms
VBCCR ListView
Fill Listview 28 ms
Switch to sorted 65 ms
Remove Doubles 40 ms
Fill Combo 5 ms
The ListView basically has all properties set to False, except for Enabled, as it's only used behind the scenes, and therefore doesn't need to be displayed, refreshed, etc.
Note: no further action is expected from my side as I can live with the 138 ms, but I thought to share this to show that different approaches can make a massive difference.
Well. The MS ListView will sort kind of "PostMessage" style so you cannot compare it directly.
I think that the VBCCR ListView will sort "directly" is rather a feature than a bug.
You do it correctly that you disable the sort while populating.
I found some spots where maybe a few milliseconds can be saved (e.g. store AddressOf in a variable etc.) When sorting after each insert. However, that fact is neglibile when sorting only once when insertions are finished.
But you can improve by eliminating the duplicates already in the recordset. Also the sorting could be outsourced to the recordset. And ultimate performance would be to make the ListView virtual and fetch the visible viewport data from the recordset only when needed.
-
Apr 11th, 2021, 10:01 PM
#3104
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
VB6sp6
VBCCR 1.7.12
i found a autoresize-bug at the StatusBar-control.
the width of the 2. panel doesnt resize after changing the content.
i have statusbar with 3 panels:
1.panel autoresize=spring
2.panel autoresize=content
3.panel autoresize=content
example:
the 2. panel displays the text "1". after i change the text to "10000" the panel doesnt resize to the new content.
setting the autoresize property to "content" again triggers the 2. panel resize.
changing the width of the statusbar also triggers the 2. panel resize.
the 3. panel always resize correct after changing the content!
Last edited by Mith; Apr 11th, 2021 at 10:12 PM.
-
Apr 12th, 2021, 04:15 AM
#3105
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Mith
VB6sp6
VBCCR 1.7.12
i found a autoresize-bug at the StatusBar-control.
the width of the 2. panel doesnt resize after changing the content.
i have statusbar with 3 panels:
1.panel autoresize=spring
2.panel autoresize=content
3.panel autoresize=content
example:
the 2. panel displays the text "1". after i change the text to "10000" the panel doesnt resize to the new content.
setting the autoresize property to "content" again triggers the 2. panel resize.
changing the width of the statusbar also triggers the 2. panel resize.
the 3. panel always resize correct after changing the content!
I found the bug. The blue marked code fixes the issue of not auto-resizing after changing the panel text.
Update will follow soon...
Code:
Friend Property Let FPanelText(ByVal Index As Long, ByVal Value As String)
If StatusBarHandle <> 0 Then
PropShadowPanels(Index).Text = Replace$(Value, vbTab, vbNullString)
Call SetPanelText(Index)
If PropShadowPanels(Index).AutoSize = SbrPanelAutoSizeContent Then Call SetParts
End If
End Property
Last edited by Krool; Apr 12th, 2021 at 02:59 PM.
-
Apr 12th, 2021, 05:55 AM
#3106
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
I think that the VBCCR ListView will sort "directly" is rather a feature than a bug.
I agree.
 Originally Posted by Krool
I found some spots where maybe a few milliseconds can be saved (e.g. store AddressOf in a variable etc.) When sorting after each insert. However, that fact is neglibile when sorting only once when insertions are finished.
I wouldn't bother if I were you.
 Originally Posted by Krool
But you can improve by eliminating the duplicates already in the recordset. Also the sorting could be outsourced to the recordset. And ultimate performance would be to make the ListView virtual and fetch the visible viewport data from the recordset only when needed.
The dataset is a collection of a custom class, not a recordset. There actually are multiple, but one example is CProduct, with properties like ID, Name, Supplier. I'm using the described process with a sorted ListView to get a list of Suppliers without duplicates. It seemed the simplest and quickest approach back in the days when I added that feature.
-
Apr 12th, 2021, 04:16 PM
#3107
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
Hi Krool,
Question about the VBFlexgrid:
I switch redraw off, and add 1000 rows with 50 columns. This takes 0.7 seconds.
Then I set sorting to one column (flexSortStringAscending). This takes 10.1 seconds. (With Redraw still off.)
Am I missing some setting, or is the grid sorting simply slow, and am I better of using a temp recordset in memory to sort, and the (re-)populate the grid?
Thanks,
Erwin
-
Apr 12th, 2021, 04:35 PM
#3108
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
Hi Krool,
Question about the VBFlexgrid:
I switch redraw off, and add 1000 rows with 50 columns. This takes 0.7 seconds.
Then I set sorting to one column (flexSortStringAscending). This takes 10.1 seconds. (With Redraw still off.)
Am I missing some setting, or is the grid sorting simply slow, and am I better of using a temp recordset in memory to sort, and the (re-)populate the grid?
Thanks,
Erwin
I just did a test with 1000 rows and 50 column. The sorting takes 0.2 seconds in IDE.
Can you provide a demo ?
Last edited by Krool; Apr 12th, 2021 at 05:02 PM.
-
Apr 12th, 2021, 08:26 PM
#3109
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
the statusbar-panel-autoresize-bug is fixed with OCX v1.7.14!
thx you!
-
Apr 13th, 2021, 04:42 AM
#3110
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
I just did a test with 1000 rows and 50 column. The sorting takes 0.2 seconds in IDE.
Can you provide a demo ?
Knowing that the grid could be fast, I investigated further and discovered that it's the SelectionMode setting that is causing the slowness. If I set it to FlexSelectionModeFree the sorting is indeed as fast as you mentioned. However, if I set it to FlexSelectionModeByRow it takes the 10 seconds I mentioned. I'm treating that setting like the Redraw now, off before sorting, and then back on, and performance is good.
One additional question, when a row is selected, the cell in the first column doesn't get the background color even if SelectionMode is set to FlexSelectionModeByRow. Is there a way around that?
Edit: you can ignore the additional question. I realized that it is the FocusRect setting that was not set to None.
Last edited by Erwin69; Apr 13th, 2021 at 04:46 AM.
-
Apr 13th, 2021, 05:38 AM
#3111
Lively Member
Re: CommonControls (Replacement of the MS common controls)
I have noticed on the DateTimePicker when CustomFormat is "dd/MM/yyyy hh:mm:ss", that its problematic when you try editing.
AllowUserInput is enabled, the selection of individual values (day, month, year, hour, minute, second) with the mouse selects the whole text.
-
Apr 13th, 2021, 06:44 AM
#3112
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
Knowing that the grid could be fast, I investigated further and discovered that it's the SelectionMode setting that is causing the slowness. If I set it to FlexSelectionModeFree the sorting is indeed as fast as you mentioned. However, if I set it to FlexSelectionModeByRow it takes the 10 seconds I mentioned. I'm treating that setting like the Redraw now, off before sorting, and then back on, and performance is good.
LOL. 
It's not a bug but a feature. In fact you are doing a 50 multi-column sort. You just were lucky with the selection mode 'Free' to have not a selection which spans multiple columns.
The code below will help you out to sort only a particular column (for all rows) and it works for every selection mode.
Code:
Dim MyColToSort As Long
MyColToSort = 5 ' or whatever else you have as input
Dim Row1 As Long, Row2 As Long, Col1 As Long, Col2 As Long
With VBFlexGrid1
Row1 = .Row: Row2 = .RowSel: Col1 = .Col: Col2 = .ColSel
.SelectRange Row1, MyColToSort, Row1, MyColToSort ' Ensure single col sort for all rows
.Sort = FlexSortStringAscending
.SelectRange Row1, Col1, Row2, Col2 ' Restore selection
End With
 Originally Posted by Semke
I have noticed on the DateTimePicker when CustomFormat is "dd/MM/yyyy hh:mm:ss", that its problematic when you try editing.
AllowUserInput is enabled, the selection of individual values (day, month, year, hour, minute, second) with the mouse selects the whole text.
Thats the point for AllowUserInput at all. To allow a text free entry. You need to parse the input accordingly in the "ParseUserInput" event.
If you don't want this turn AllowUserInput off (=False, which is the default)
Last edited by Krool; Apr 13th, 2021 at 06:58 AM.
-
Apr 13th, 2021, 11:20 AM
#3113
Lively Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
LOL. 
Thats the point for AllowUserInput at all. To allow a text free entry. You need to parse the input accordingly in the "ParseUserInput" event.
If you don't want this turn AllowUserInput off (=False, which is the default)
Thanks, this is when We bang our heads and say "how stupid am I"
-
Apr 13th, 2021, 12:05 PM
#3114
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
LOL. 
It's not a bug but a feature. In fact you are doing a 50 multi-column sort. You just were lucky with the selection mode 'Free' to have not a selection which spans multiple columns.
OK, then it makes sense that it needed a bit more time to sort. 
I'm using version 1.04.0032 of the VBFlexgrid OCX. SelectRange is an unknown property?
Would this approach give the same result as your code example?
Code:
With VBFlexGrid1
.SelectionMode = FlexSelectionModeFree
.Redraw = False
.col = iColumn
.Sort = flexSortStringAscending
.SelectionMode = FlexSelectionModeByRow
.Redraw = True
End With
-
Apr 13th, 2021, 12:17 PM
#3115
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
OK, then it makes sense that it needed a bit more time to sort.
I'm using version 1.04.0032 of the VBFlexgrid OCX. SelectRange is an unknown property?
Would this approach give the same result as your code example?
Code:
With VBFlexGrid1
.SelectionMode = FlexSelectionModeFree
.Redraw = False
.col = iColumn
.Sort = flexSortStringAscending
.SelectionMode = FlexSelectionModeByRow
.Redraw = True
End With
Not assured. If the row sel "range" is more than 1 only those rows will be sorted.
So a extra .RowSel = .Row would help.
-
Apr 13th, 2021, 12:22 PM
#3116
Hyperactive Member
Re: CommonControls (Replacement of the MS common controls)
In my grid I have also columns with percentages (e.g. 7.3% and 54.9%) and columns with dimensions (e.g. 7.2cm and 14.6cm or 3.1" and 6.2"). MSFlexgrid sorts these without problems using the Numeric sorts, but the VBFlexGrid doesn't. What is the recommended way to sort these?
-
Apr 13th, 2021, 12:47 PM
#3117
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Erwin69
In my grid I have also columns with percentages (e.g. 7.3% and 54.9%) and columns with dimensions (e.g. 7.2cm and 14.6cm or 3.1" and 6.2"). MSFlexgrid sorts these without problems using the Numeric sorts, but the VBFlexGrid doesn't. What is the recommended way to sort these?
Need to test... and if something needs to be enhanced.
Worst case "custom sort option" which raise event.
Edit: you may store the percentage as number only and use .ColFormat property to add the "%" char as formatting. Thus the sort would work as immediate solution.
Btw. you can sort also using the cell property
Code:
.Cell(FlexCellSort, Row1, Col1, Row2, Col2) = flexSortStringAscending
This way you don't need to bother change row col etc. and to restore it..
Edit: please continue in the VBFlexGrid thread!
Last edited by Krool; Apr 13th, 2021 at 01:11 PM.
-
Apr 14th, 2021, 04:02 AM
#3118
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
Edit: please continue in the VBFlexGrid thread!
Why not combine the 2 projects?
I think it is unlikely that a VBFlexGrid user doesn't use VBCCR...
Just a thought.
-
Apr 14th, 2021, 06:34 PM
#3119
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
Why not combine the 2 projects?
I think it is unlikely that a VBFlexGrid user doesn't use VBCCR...
Just a thought.
Im a VBCCR user and i dont use VBFlexGrid and for me it looks like someone spams the forum with postings not related to VBCCR...
-
Apr 17th, 2021, 07:14 PM
#3120
Re: CommonControls (Replacement of the MS common controls)
I'm sorry about that.
I'm not dissatisfied, I'm just saying that the control is very good.It is suggested to add some transparent functions, because 99% of people do not have the ability to modify it at all.After all, all VB.NET controls are transparent.Today, 23 years later, we are developing a basic control with some new elements. Such as a transparent background or translucent mask.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|