-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
It's kinda hard to read the text in your screenshot but as far as I can distinguish you are calling "CreateWindowEx" and the last parameter is "ObjPtr(Me)" for some reason. MSDN says that parameter must be a pointer to window-creation data. Pretty sure you should put zero in there and it will work correctly.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi, thanks, if you click under "Found when it hangs:" i think the image will be open in another tab and bigger.
This code is nost mine, is in krool's project, I will try to use a zero on it, but if it's a bug, maybe krool can tell us more.
I will try it asap.
Thanks again !
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Tried.
Using Zero it hangs directly. :-(
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Maybe it fails on CreateWindowsEx because VBFlexGridWndClass failed to register previously?
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
But it's too strange.... it works fine when i load the project the first time, then if i edit a form that has on it a grid, save it, and then if i start he project, when i open a form with a grid... hangs.
It's like when exiting the fist time, it's not releasing something (i can check if a have some previous version of the grid, i think this didn't happen, i will take a look and try it.).
the form i'm editing has 2 Grids on it, but it happens the same (i think) with a form with only 1 grid
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Exactly!
The problem is this code:
Code:
Public Sub FlexWndRegisterClass()
If (FlexClassAtom Or FlexRefCount) = 0 Then
Dim WCEX As WNDCLASSEX, ClassName As String
ClassName = "VBFlexGridWndClass"
With WCEX
.cbSize = LenB(WCEX) '48
' CS_VREDRAW and CS_HREDRAW will not be specified as entire redraw upon resize is not necessary.
.dwStyle = CS_DBLCLKS '8
.lpfnWndProc = ProcPtr(AddressOf FlexWindowProc) '38412116 ---- 38439988
.cbWndExtra = 4
.hInstance = App.hInstance '4194304 ------- 4194304
.hCursor = LoadCursor(0, IDC_ARROW) '65541 --------- 65541
.hbrBackground = 0
.lpszClassName = StrPtr(ClassName) '148822172 ---- 148357940
End With
FlexClassAtom = RegisterClassEx(WCEX) '-15529 --- 0 <---- i think this is the problem
If FlexSplitterBrush = 0 Then
I wrote the values of the first run (when everything works) in red.
And on it's right side, the ones from a second run (when it will hang)
It's not working the registerclassEx(wcex)
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
MSDN says that: "All window classes that an application registers are unregistered when it terminates.". So this works correctly in a compiled EXE but in IDE you need to use "UnregisterClass" on "Form_Unload" if you want to start the app again without closing the IDE.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
The problem might be that UserControl_Terminate won't fire in the first run ? Can you confirm?
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
It fires fine.
Maybe the problem is when i have 2 grids in the same form ? that it only fires one time ?
Let me check it
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
CONFIRMED!
If i modify a form that has 2 grids (when i say modify, i mean add any line of code, a comment is valid too), and save the project, then i start the project and load any form with a grid, it hangs.
Loading any form with a grid, not necessarily the one i modified, the project hangs.
It seems only unloads one grid, not the second one.
I think that, because if i modify a form with ONLY 1 grid on it, everything runs fine, no hangs at all.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Tried to fix It by myself, but... Lack of knowledge... :-(
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Calcu
Tried to fix It by myself, but... Lack of knowledge... :-(
Can you share a demo project isolating the problem?
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I was creating a simple project (added) :
3 forms + your project , everything was fine... (strange)
And i just added 1 control (a control to show tabs on a MDI form), and it broken everything...
Added the project with the control... the tlb used with the control is who messed everything...
Let's see if you can identify the problem (looking to when the problem appeared.... i don't think it's on your code, but...)
Open my project
check the references, because i have the tlb on my system directory (added all the necessary at the zip file)
open 1 form
write anything on the code
save
you will see the grids grayed.
it will hang on open
Attachment 187254
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
In your project are some files missing to reproduce the error.
There are some classes that you need to make the RevMDITabs usercontrol run as a part of your project.
You could avoid this problem (and you did it halfway) by including the ocx to the components of your project INSTEAD of implementing the source for the control.
But if you do so you must include ALL parts of the OCX-source into you project (there is a BAS and three CLS not in your project).
So do as I did:
- remove the usercontrol from your MDIForm
- remove the component from the project
- add all parts of the usercontrol OCX to your project
- add the usercontrol from your project to your MDIform
Save the project and - enjoy
Greetings
I you do so (and I did), then there is no problem to edit you project or run it and fill the grids.
Greetings
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I think i added all of them inside the project zip, just add them again when open the vbp, because i have them registered in another paths in my computer
Maybe i'm wrong ?
Edit 1:
you are right, i found the missing class (that's the problem when you create a project too fast..., sorry) 1 sec.
Edit2:
Checked twice, now it's complete.
Attachment 187258
can you test it ? you will know if it will hang, because the grid will be grayed when you push the save project button.
But.. there has to be something else, i have 2 diferents project without this control, and they are having the same problem.
Edit 3:
try this steps, i finally made it hung:
1.-open the project
2.- close all forms
3.- open form1
4.- click on save
5.- edit form_load (from form1), insert some comment : 'aaaaaa
6.- change to form view
7.- save again
8.- go to project - components - add microsoft windows common controls-2 6.0
9.- apply
you will see the grids grayed.
i think i can make a video
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
uploaded a video showing what it does.
If a run the project when the grid grayed out, it force closes the IDE
unzip the file and look at the video
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi all,
I think I found another bug.
I have a little sub to display a background color:
Code:
Public Sub Degradado(ElObjecto As Object)
Dim i As Single
Dim Y As Single
ElObjecto.DrawStyle = 6 '0
ElObjecto.DrawMode = 13 '13
ElObjecto.DrawWidth = 2 '1
ElObjecto.ScaleMode = 3 ' 1
ElObjecto.ScaleHeight = (256 * 2) '12150
For i = 255 To 0 Step -1
ElObjecto.Line (0, Y)-(ElObjecto.Width, Y + 2), RGB(i, i, i), BF
Y = Y + 2
Next i
End Sub
If i call it in the form_Resize event, the .hitrow of the grid is always returning -1. ¿?
If i comment scalemode and scaleheight from this sub, then the grid works as usual.
Ok, just using Scalemode = 3 in the form prop. it just doesn't work the .hitrow value
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Calcu
Hi all,
I think I found another bug.
I have a little sub to display a background color:
Code:
Public Sub Degradado(ElObjecto As Object)
Dim i As Single
Dim Y As Single
ElObjecto.DrawStyle = 6 '0
ElObjecto.DrawMode = 13 '13
ElObjecto.DrawWidth = 2 '1
ElObjecto.ScaleMode = 3 ' 1
ElObjecto.ScaleHeight = (256 * 2) '12150
For i = 255 To 0 Step -1
ElObjecto.Line (0, Y)-(ElObjecto.Width, Y + 2), RGB(i, i, i), BF
Y = Y + 2
Next i
End Sub
If i call it in the form_Resize event, the .hitrow of the grid is always returning -1. ¿?
If i comment scalemode and scaleheight from this sub, then the grid works as usual.
Ok, just using Scalemode = 3 in the form prop. it just doesn't work the .hitrow value
.HitRow just works if you do a .HitTest before. If you want a direct result of the current cursor position you can use .MouseRow.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I tested it yesterday, it wasn't working
With Form in Twips:
Attachment 187263
It shows the row i clicked
Attachment 187262
If i change the form to Pixel:
Attachment 187264
The same code throw:
Attachment 187265
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Calcu
The flex grid wants always twips. (Like MSFlexGrid)
You can have a Form as pixels, you just need to use Form.ScaleXY to convert to twips.
So its not a bug but a feature.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Thanks!, understood.
Edit:
Have you been able to reproduce the other error?
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Update released.
The new read-only properties ComboButtonWidth/ComboButtonClientWidth are helpful to use with button pictures.
If a button picture is too large it will be truncated. The height of the combo button is determined by the row height, but the width was fixed.
For drop-down button the width will continue to be fixed. So the new ColComboButtonWidth(i) property only is applicable for combo mode 3 - Button. (where only there a picture can be placed)
Below is a code example to make best-fit width of a certain picture.
Code:
Dim NonClientWidth As Long, Picture As IPictureDisp
NonClientWidth = VBFlexGrid1.ComboButtonWidth - VBFlexGrid1.ComboButtonClientWidth
Set Picture = Picture1.Picture
Set VBFlexGrid1.ColComboButtonPicture(1) = Picture
VBFlexGrid1.ColComboButtonWidth(1) = NonClientWidth + Me.ScaleX(CHimetricToPixel_X(Picture.Width), vbPixels, vbTwips)
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi all, can anybody tell me what event must i use to detect that some text is pasted from the clipboard?
I'm pasting fine (control + v), but i can't detect a change or i don't know how to do it, i want to check what the user pasted and i can't detect when it was done...
Ideas?
Thanks!
Edit:
Solved this way, but i have to test it more:
In the Keydown event of the grid:
Code:
Private Sub Gr1_KeyDown(KeyCode As Integer, Shift As Integer)
' copiar: CTRL-C, CTRL-X, CTRL-INS
If KeyCode = vbKeyC And Shift = 2 Then Copiando = True
If KeyCode = vbKeyX And Shift = 2 Then Copiando = True
If KeyCode = vbKeyInsert And Shift = 2 Then Copiando = True
' pegar: CTRL-V, SHIFT-INS
If KeyCode = vbKeyV And Shift = 2 Then Pegando = True
If KeyCode = vbKeyInsert And Shift = 1 Then Pegando = True
End Sub
And then in the SelChangeEvent:
Code:
Private Sub Gr1_SelChange()
If Pegando Then
Gr1.AutoSize 0, 14, FlexAutoSizeModeColWidth, FlexAutoSizeScopeAll, False, 50
'more things to check
Pegando = False
End If
End Sub
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi Krool,
I'm trying to highlight a compete row when I select it. I can't seem to get column 0 to turn background blue like the rest of the columns in the row. What am I missing?
Is there a way to unselect the row with a mouse click?
I'm having great results using VB6 to create OCX forms and class libraries ScriptBasic can recieve event callbacks from and access the form OCX classes using it 'CallByName' COM extension module.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
ScriptBASIC
I'm having great results using VB6 to create OCX forms and class libraries ScriptBasic can recieve event callbacks from and access the form OCX classes using it 'CallByName' COM extension module.
sounds interesting.
Could you share your script language.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
ScriptBasic is an open source (MIT Common licensed) written in ANSI C. I have been maintaining the embeddable scripting engine since 2005. ScriptBasic runs on everything with unlimited expansion with it's C extension module API.
You can download ScriptBasic for Windows 32 bit install from HERE.
This is a screen shot of a current support time entry project I'm working on for a client. It uses ScriptBasic for base language and a VB6 OCX form / class COM DLL for the UI. I used ODBC to access both MS SQL and Sage 100 accounting software. I'm also using Sage 100's customer lookup via a BOI (Business Object Interface) without showing the Customer maintenance form which is done in ProvideX Business Basic.
https://www.vbforums.com/images/ieimages/2023/04/19.png
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
ScriptBASIC
ScriptBasic is an open source (MIT Common licensed) written in ANSI C. I have been maintaining the embeddable scripting engine since 2005. ScriptBasic runs on everything with unlimited expansion with it's C extension module API.
You can download ScriptBasic for Windows 32 bit install from
HERE.
interesting i will take a look
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
ScriptBASIC
Hi Krool,
I'm trying to highlight a compete row when I select it. I can't seem to get column 0 to turn background blue like the rest of the columns in the row. What am I missing?
Is there a way to unselect the row with a mouse click?
I'm having great results using VB6 to create OCX forms and class libraries ScriptBasic can recieve event callbacks from and access the form OCX classes using it 'CallByName' COM extension module.
Make .FocusRect = FlexFocusRectNone and .SelectionMode to either ByRow or FreeByRow.
If you then make .AllowMultiSelection = True you can unhighlight by ctrl+click.
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Krool,
Thanks for the reply. That didn't seem to work. I tried to disable multi-line select but that didn't work either.
Code:
TableGrid.FocusRect = FlexFocusRectNone
TableGrid.SelectionMode = FlexSelectionModeByRow
TableGrid.AllowMultiSelection = False
Attachment 187473
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
ScriptBASIC
Krool,
Thanks for the reply. That didn't seem to work. I tried to disable multi-line select but that didn't work either.
Code:
TableGrid.FocusRect = FlexFocusRectNone
TableGrid.SelectionMode = FlexSelectionModeByRow
TableGrid.AllowMultiSelection = False
Attachment 187473
Can you provide a demo? For me it worked..
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I'll create a simple .exe form with just VBFLXGRD and zip up the source. Thanks for your help!
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Krool,
All of a sudden it started working correctly while working on a non-grid portion of the code. I think your code additions finally woke up. :)
https://www.vbforums.com/images/ieimages/2023/04/30.png
Thanks for the help getting this working!
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
OCX version 1.6 released.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi all!
I'm enjoying a lot this grid, thanks again Krool.
Just a question, when copying the data from the grid, and pasting it in a email, is there any option to paste the lines of the selected cells too ?
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
Update released.
AllowUserFreezing property now included.
Also the new AfterUserFreeze event fires after a user changed the number of frozen rows or columns.
Hi, Krool!
Can you tell us how can a user change the number of frozen rows or columns? I know how to do it by code (FrozenRows property), but it will not fire the AfterUserFreeze event. How does it work?
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Nouyana
Hi, Krool!
Can you tell us how can a user change the number of frozen rows or columns? I know how to do it by code (FrozenRows property), but it will not fire the AfterUserFreeze event. How does it work?
Ensure that you have the AllowUserFreezing property set to True.
Below gif says more than words.
Attachment 187746
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
Below gif says more than words.
Thank you very much!
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
For me it worked..
It works fine, but, in my opinion, the rectangle should not disappear when focus is changed to another control (unlike the MSFlexGrid).
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I don't know what does it mean, but when I start the DEMO project (the last version) I give this error. The project is loaded and works fine.
WinXp SP3
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Nouyana
I don't know what does it mean, but when I start the DEMO project (the last version) I give this error. The project is loaded and works fine.
WinXp SP3
That's the VB6 IDE (dataview.dll) and has nothing todo with this project.
You may get rid of it when you rename said dll to let's say "_dataview.dll".
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Krool,
Is it a "by design" behaviour?
Code:
Private Sub Form_Load()
Dim i As Integer
With FlexGrid1
.FocusRect = FlexFocusRectNone
.TabBehavior = FlexTabNext ' Next what?
.Cols = 4 ' Creating columns
.FixedRows = 0
.Rows = 0
For i = 1 To 50 ' Creating 50 records.
.AddItem "Record " & vbTab & i & vbTab & i * 100 & vbTab & "text"
Next i
End With
End Sub
Private Sub txtTextBox_GotFocus(Index As Integer)
txtTextBox(Index).BackColor = vbRed
End Sub
Private Sub txtTextBox_LostFocus(Index As Integer)
txtTextBox(Index).BackColor = vbWhite
End Sub
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Nouyana
Krool,
Is it a "by design" behaviour?
Code:
Private Sub Form_Load()
Dim i As Integer
With FlexGrid1
.FocusRect = FlexFocusRectNone
.TabBehavior = FlexTabNext ' Next what?
.Cols = 4 ' Creating columns
.FixedRows = 0
.Rows = 0
For i = 1 To 50 ' Creating 50 records.
.AddItem "Record " & vbTab & i & vbTab & i * 100 & vbTab & "text"
Next i
End With
End Sub
Private Sub txtTextBox_GotFocus(Index As Integer)
txtTextBox(Index).BackColor = vbRed
End Sub
Private Sub txtTextBox_LostFocus(Index As Integer)
txtTextBox(Index).BackColor = vbWhite
End Sub
Yes it is. TabBehavior and WrapCellBehavior work together.
So just play each combination and look what is good for you.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
TabBehavior and WrapCellBehavior work together.
So just play each combination and look what is good for you.
Thank you, Krool!
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
Included AutoClipboard property.
It seems that AutoClipboard property is not working for me. WinXP SP3.
Attachment 187755
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
List of enhancements and improvements in relation to the MSFlexGrid and/or MSHFlexGrid control:
- BackColorAlt property included to set alternate row back colors.
In fact, I will never use this property. For me it looks dazzled. But if somebody use the BackColorAlt, don't he need a ForeColorAlt property?
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Another question is about the BeforeEdit event. What does the FlexEditReasonBackSpace constant mean? I can't get into edit mode by BackSpace. The BeforeEdit event fires, but I can't edit anything. And my arrow keys become frozen. WinXP SP3.
Attachment 187756
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I don't know if it is a feature or a bug, but when I use the MsgBox function inside the BeforeUserResize event, the VBFlexGrid captures my mouse until I change active cell. WinXP SP3
Attachment 187767
Code:
Private Sub FlexGrid1_BeforeUserResize( _
ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
MsgBox "d"
End Sub
Private Sub Form_Load()
Dim i As Integer
With FlexGrid1
.SelectionMode = FlexSelectionModeByRow
.AllowMultiSelection = True
.AllowBigSelection = False
.FocusRect = FlexFocusRectNone
.Align = vbAlignTop
.AllowUserResizing = FlexAllowUserResizingBoth
.AllowUserEditing = True
.Cols = 4
.FixedRows = 1
.Rows = 1
For i = 1 To 50
.AddItem "Record " & vbTab & i & vbTab & i * 100 & vbTab & "text"
Next i
End With
End Sub
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
Included BestFitMode property which defaults to 0 - TextOnly (used for AutoSize/FormatString) to behave like intended.
Else you can choose between 1 - Full, 2 - SortArrowText or 3 - OtherText.
Having 2 - SortArrowText is the same as previous behavior, means leaving the other contents (checkbox, combocue) un-measured.
Krool, can you please explain in more detail, how to use Full and OtherText modes.
EDITED. For what purposes do we have the "2 - SortArrowText" mode if it has "the same behavior"?
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
The BorderStyle's default value is 3, not 1. It looks the same style, but incompatible with MS.
EDITED. Maybe FlexBorderStyleSunken should be 1 (default) and FlexBorderStyleSingle should be 3?
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Memory consumption test.
Using the same memory (~1.3gb):
- MSHFlexGrid can load 4 250 000 records (4 fields, 256mb mdb-database)
- VBFlexGrid can load 1 750 000 records (4 fields, 104mb mdb-database)
Speed test.
Using the same database (1 750 000 records, 4 fields, 104mb mdb):
- MSHFlexGrid loads data in 49 seconds
- VBFlexGrid loads data in 19 seconds
So, the VBFlexGrid is 2.5 times faster, but consumes 2.5 times more memory.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Nouyana
The BorderStyle's default value is 3, not 1. It looks the same style, but incompatible with MS.
EDITED. Maybe FlexBorderStyleSunken should be 1 (default) and FlexBorderStyleSingle should be 3?
The BorderStyle can be considered "not compatible" because it has more options then the original property. Won't change it..
Quote:
Originally Posted by
Nouyana
Memory consumption test.
Using the same memory (~1.3gb):
- MSHFlexGrid can load 4 250 000 records (4 fields, 256mb mdb-database)
- VBFlexGrid can load 1 750 000 records (4 fields, 104mb mdb-database)
Speed test.
Using the same database (1 750 000 records, 4 fields, 104mb mdb):
- MSHFlexGrid loads data in 49 seconds
- VBFlexGrid loads data in 19 seconds
So, the VBFlexGrid is 2.5 times faster, but consumes 2.5 times more memory.
That sounds logical. Because the VBFlexGrid has more internal data (more features/formats etc.) it is natural that the overall memory consumption is more.
Quote:
Originally Posted by
Nouyana
Krool, can you please explain in more detail, how to use Full and OtherText modes.
EDITED. For what purposes do we have the "2 - SortArrowText" mode if it has "the same behavior"?
TextOnly measures only text. SortArrowText measure in addition the sort arrow indicator. Full measures everything. OtherText measures everything except sort arrow indicator.
Quote:
Originally Posted by
Nouyana
I don't know if it is a feature or a bug, but when I use the MsgBox function inside the BeforeUserResize event, the
VBFlexGrid captures my mouse until I change active cell. WinXP SP3
Attachment 187767
[CODE]Private Sub FlexGrid1_BeforeUserResize( _
ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
MsgBox "d"
End Sub
It makes no sense to display a msgbox if you want active user resizing. It makes sense if you want to cancel the user resizing.
In this case ensure to make a before the MsgBox.
Quote:
Originally Posted by
Nouyana
In fact, I will never use this property. For me it looks dazzled. But if somebody use the BackColorAlt, don't he need a ForeColorAlt property?
The idea if the BackColorAlt is to make alternative back colors from row to row, which can increase readibility for the eyes to "follow" better from left to right in a row.
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Nouyana
Another question is about the BeforeEdit event. What does the FlexEditReasonBackSpace constant mean?
I can't get into edit mode by BackSpace. The BeforeEdit event fires, but I can't edit anything. And my arrow keys become frozen. WinXP SP3.
Attachment 187756
For me it works. When you enter into edit by backspace the text is erased by default.
Attachment 187800
Quote:
Originally Posted by
Nouyana
It seems that
AutoClipboard property is not working for me. WinXP SP3.
Attachment 187755
The AutoClipboard property is for copying pasting cells when you are "not" in edit mode. When you are in edit mode you just copy paste the text contents like in any normal TextBox.
-
1 Attachment(s)
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
For me it works. When you enter into edit by backspace the text is erased by default.
Pressing the backspace under WinXP just crashes the IDE or EXE. May be you shoul fix it or change the minimal system requrements.
Attachment 187801
EDITED. For WinXP users:
Code:
Private Sub VBFlexGrid1_BeforeEdit(Row As Long, Col As Long, ByVal Reason As VBFLXGRD16.FlexEditReasonConstants, Cancel As Boolean)
If Reason = FlexEditReasonBackSpace Then Cancel = True
End Sub
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Nouyana
Pressing the backspace under WinXP just crashes the IDE or EXE. May be you shoul fix it or change the minimal system requrements.
Attachment 187801
EDITED. For WinXP users:
Code:
Private Sub VBFlexGrid1_BeforeEdit(Row As Long, Col As Long, ByVal Reason As VBFLXGRD16.FlexEditReasonConstants, Cancel As Boolean)
If Reason = FlexEditReasonBackSpace Then Cancel = True
End Sub
That's indeed a bug. The error is on the following line (for BackSpace)
Code:
SendMessage VBFlexGridEditHandle, EM_REPLACESEL, 1, ByVal 0&
The NULLPTR is a problem on Windows XP for EM_REPLACESEL. I fixed that already in the VBCCR TextBox but missed that one for the VBFlexGrid.
Solution (fix) is as following:
Code:
SendMessage VBFlexGridEditHandle, EM_REPLACESEL, 1, ByVal StrPtr("")
I will release fix. Thanks
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
VBFlexGrid has more internal data (more features/formats etc.) it is natural that the overall memory consumption is more.
Can you add a conditional compilation constant or maybe just a property to disable the most memory consuming features?
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Krool
Solution (fix) is as following:
Code:
SendMessage VBFlexGridEditHandle, EM_REPLACESEL, 1, ByVal StrPtr("")
Yes, this works. Thank you.
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi, Krool!
I continue to test your grid, and, if you find it useful, I'll continue to post the results here.
I don't know, is it a bug or feature, but Cell(FlexCellHeight) property ignores the RowSel and ColSel parameters. It seems logical to me if the Cell property (FlexCellHeight and FlexCellWidth) will return the width and height of the range, and not just the first cell.
For testing:
Code:
Private Sub Command1_Click()
With FlexGrid1
Debug.Print "Left: "; .Cell(FlexCellLeft, .Row, .Col, .RowSel, .ColSel)
Debug.Print "Top: "; .Cell(FlexCellTop, .Row, .Col, .RowSel, .ColSel)
Debug.Print "Height:"; .Cell(FlexCellHeight, .Row, .Col, .RowSel, .ColSel)
Debug.Print "Width: "; .Cell(FlexCellWidth, .Row, .Col, .RowSel, .ColSel)
Debug.Print "Row, Col: "; .Row; .Col
Debug.Print "RowSel,ColSel: "; .RowSel; .ColSel
Debug.Print "================"
End With
End Sub
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
What should .Cell(FlexCellBackColor, .Row, .Col, .RowSel, .ColSel) return when all cells have a different color?
For the .Cell property not all parameters are always used.
You can often "set" it for a range of cells, but "get" will return the value for a single cell, just the row and col specified.
Same goes for the vsFlexGrid by ComponentOne
-
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Quote:
Originally Posted by
Arnoutdv
What should .Cell(FlexCellBackColor, .Row, .Col, .RowSel, .ColSel) return when all cells have a different color?
This is an incorrect example because the Cell(FlexCellBackColor) property ignores RowSel and ColSel parameters only in the Property Get part, but not in the Property Let.
Anyway, the programmer should understand what to expect from the property behavour. And in my oppinion this sub should return the whole width of selected range:
Code:
Private Sub Command1_Click()
With FlexGrid1
Debug.Print "Width: "; .Cell(FlexCellWidth, .Row, .Col, .RowSel, .ColSel)
End With
End Sub
If you want to work only with the first cell, you can omit RowSel and ColSel parameters.
It is not very difficult to implement/fix.