Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Attachment 196173
When a form contains two tables, clicking the middle position between the two columns in the image causes the mouse cursor to jump immediately to the upper section.
When you click on the upper table, it scrolls up by a small amount; when you click on the lower table, it scrolls up by a large amount.
This issue does not occur when there is only one table in the form.
The problem disappears after setting the Windows display scale to 100%. How can I resolve this? Thank you very much!
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by fengzhongxia
Attachment 196173
When a form contains two tables, clicking the middle position between the two columns in the image causes the mouse cursor to jump immediately to the upper section.
When you click on the upper table, it scrolls up by a small amount; when you click on the lower table, it scrolls up by a large amount.
This issue does not occur when there is only one table in the form.
The problem disappears after setting the Windows display scale to 100%. How can I resolve this? Thank you very much!
Sounds weird. Only when more than one ?! With the scale then it must be sonething with dpi scaling.
I can't see your image. Maybe a small demo project would be good.
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
Sounds weird. Only when more than one ?! With the scale then it must be sonething with dpi scaling.
I can't see your image. Maybe a small demo project would be good.
This issue only occurs after moving the window to the position shown in the illustration and then clicking; it does not occur at the default window position.
This issue only occurs after moving the window to the position shown in the illustration and then clicking; it does not occur at the default window position.
When you include a new control "SplitContainer" you can not just blindly run the demo without checking the code.
For example. I changed "VBFlexGrid1" into "SplitContainer1" in the Form_Resize event and then the problems disappeared..
Code:
Private Sub Form_Resize()
Dim Width As Single, Height As Single
Width = Me.ScaleWidth - SplitContainer1.Left - Me.ScaleX(8, vbPixels, Me.ScaleMode)
Height = Me.ScaleHeight - (PicturePanel.Height) - Me.ScaleY(8, vbPixels, Me.ScaleMode)
If Width > 0 Then SplitContainer1.Width = Width
If Height > 0 Then SplitContainer1.Height = Height
End Sub
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi Krool, I need the old version of your VBFlexGrid.ctl user control because I’d like to release a portable version of the app I’m developing (a freeware interactive first-aid simulator). I’m unable to integrate the newer controls with DataBinding into the project. Where canJ find it? Thank in advance.
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Walter_1949
Hi Krool, I need the old version of your VBFlexGrid.ctl user control because I’d like to release a portable version of the app I’m developing (a freeware interactive first-aid simulator). I’m unable to integrate the newer controls with DataBinding into the project. Where canJ find it? Thank in advance.
Hi Walter,
it's better to use a new version and let's find out what your issue is in detail so it can be fixed.
Thanks
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Thanks Krool for your kind and prompt reply. I downloaded the set of files from GitHub and, after OLEGuids.tlb, integrated them into a new project in this order: 2 .bas > 2.cls > .CT; then saved and closed VB6. But if I try to launch the app, even without any VBgrid, or if I try to draw one on the form, I alwayes get an error at this point:
Private PropDataSource As MSDATASRC.DataSource, PropDataMember As MSDATASRC.DataMember, PropRecordset As Object
Asking the AI "WHY?", its answer is: to fix this issue use the oldest version, without DataBinding, of Krool User Control (I use the simplest functions of your grid).
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Walter_1949
Thanks Krool for your kind and prompt reply. I downloaded the set of files from GitHub and, after OLEGuids.tlb, integrated them into a new project in this order: 2 .bas > 2.cls > .CT; then saved and closed VB6. But if I try to launch the app, even without any VBgrid, or if I try to draw one on the form, I alwayes get an error at this point:
Private PropDataSource As MSDATASRC.DataSource, PropDataMember As MSDATASRC.DataMember, PropRecordset As Object
Asking the AI "WHY?", its answer is: to fix this issue use the oldest version, without DataBinding, of Krool User Control (I use the simplest functions of your grid).
Ok, you got an AI answer and that mislead me..
So, either make a reference to msdatsrc.tlb that is in C:\Windows\SysWOW64
Or set the compilation constant ImplementDataSource to False in the .ctl file.
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Dear Krool,
I solved all problems doing with VB6.0 a new GRID User Control which meets my needs. It's light but enough powerfull for any simple app.
Thanks for you kindness and for your valuable contribution to community
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hello. I don't know if this issue was at some point mentioned, but the MSHFlexGrid, unlike the MSFlexGrid, doesn't fire the SelChange event when the Col and Row properties are changed programmatically. The event only fires with user interaction. VBFlexGrid goes back to MSFlexGrid behavior of firing the event.
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Eduardo-
Hello. I don't know if this issue was at some point mentioned, but the MSHFlexGrid, unlike the MSFlexGrid, doesn't fire the SelChange event when the Col and Row properties are changed programmatically. The event only fires with user interaction. VBFlexGrid goes back to MSFlexGrid behavior of firing the event.
I decided to go to the MSFlexGrid behavior as this is more convenient to have SelChange always fired. I guess, no issue, or ?
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
The vsFlexGrid from ComponentOne also fires the SelChange event when changing Row/Col properties
Setting the .Row/.Col will fire the SelChange, but also the .Select method fires the SelChange event.
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
I decided to go to the MSFlexGrid behavior as this is more convenient to have SelChange always fired. I guess, no issue, or ?
The issue is that other components that need to access cell properties need to change the current cell to access them. And the client program can have code in the SelChange event. In the best case it causes only a performance issue, but in other cases it can make the program to behave wrongly, like it was a recent case where I had put in the event code this:
Code:
HandleSelChange GridName
Private Sub HandleSelChange(nGrd As VBFlexGrid)
Static s As Boolean
If (Not s) And (nGrd.Row > 0) And (nGrd.MouseRow > 0) Then
s = True
nGrd.Row = nGrd.RowSel
nGrd.Col = 0
nGrd.ColSel = nGrd.Cols - 1
s = False
End If
End Sub
I forgot about that code, and after using that component (that is a FlexGrid exporter to Excel that I'll soon post in the Codebank) I saw that the cell format that I saw in Excel for that particular grid report (unlike other ones that were OK) was always of column 0. I didn't realize why until with further debugging I found that code in the SelChange event procesure.
But it is already solved, not only in my client program where I've put a flag, but also in my exporter.
I attach the code that allows to suspend third party controls events here.
This was made by Claude AI with my help and assistance in testing things and copying to it the definitions it wanted from the VB6 Object Browser, and also pushing it a bit because at some point it had said "there is no way to do that" (it was to find some Event IDs from VB6 code). But I responded that "If TLBINF32.DLL can do that why we can't?". And it could...
About whether it is better to raise the events or not, I think both options have advantages and disadvantages, so I don't have an opinion.