Page 9 of 34 FirstFirst ... 678910111219 ... LastLast
Results 321 to 360 of 1324

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #321
    New Member
    Join Date
    Aug 2019
    Posts
    5

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    I don't understand. If you want to forbid cell's editing then set AllowUserEditing to False (Default)
    Nevermind. I found it already)
    But I have another question: can you add autosave of data from grid to database (like MS DataGrid 6.0) after changing cells.
    Last edited by SPB-667; Aug 10th, 2019 at 12:50 PM.

  2. #322

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by SPB-667 View Post
    But I have another question: can you add autosave of data from grid to database (like MS DataGrid 6.0) after changing cells.
    This a replacement for the FlexGrid control and not for the DataGrid control. There is no direct binding available in the MSFlexGrid control, so the VBFlexGrid doesn't either.
    However, in my opinion, it is anway better to have the database unbound to the grid. If you change something in the grid it's in your control what happens after that in the database.

  3. #323
    Junior Member
    Join Date
    Aug 2018
    Posts
    18

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi,

    I've tried this on 2 different machines, both Win 10 64bit, but the IDE just crashes when I run, compile or try to view MainForm.
    I've put the OLEGuids files in SysWOW64 and the IDE looks to find them OK. I have not registered them in any way. Just overwrote the old OLEGuids I had there.

    Any ideas?


    Update: removed "MainForm" and changed Sub Main() to show "UserEditingForm" instead and then the program runs fine.

    -Leifster
    Last edited by leifmb; Aug 29th, 2019 at 03:57 AM.

  4. #324

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by leifmb View Post
    I've tried this on 2 different machines, both Win 10 64bit, but the IDE just crashes when I run, compile or try to view MainForm.
    I've put the OLEGuids files in SysWOW64 and the IDE looks to find them OK. I have not registered them in any way. Just overwrote the old OLEGuids I had there.

    Any ideas?


    Update: removed "MainForm" and changed Sub Main() to show "UserEditingForm" instead and then the program runs fine.
    To be honest. I understanding nothing what you are describing.
    For me the MainForm works. And that only UserEditingForm works but not MainForm is an indication that it's not the VBFlexGrid's nor OLEGuids.tlb's fault.

  5. #325
    Junior Member
    Join Date
    Aug 2018
    Posts
    18

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I guess it's something wrong with my VB6 setup/installation then. I've seen similar behavior once or twice before.
    Just tested on my 3rd VB6 machine and it has the very same problem :-(

    Off topic: There are many different guides on how to install VB6 on Windows 10, all with some variations. Is there a definitive guide somewhere?

  6. #326
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,997

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by leifmb View Post
    I guess it's something wrong with my VB6 setup/installation then. I've seen similar behavior once or twice before.
    Just tested on my 3rd VB6 machine and it has the very same problem :-(

    Off topic: There are many different guides on how to install VB6 on Windows 10, all with some variations. Is there a definitive guide somewhere?
    I suggest to ask this question in the general forum.

    If it is of any comfort to you, from time to time (may be every two or three months) I need to uninstall and reinstall VB6 because I start to experience quasi random crashes of the IDE (I have Windows 10 - 64 bits).
    I usually also clean the registry with a registry cleaner after uninstalling and before reinstalling (but I don't know if that is necessary).

  7. #327

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Often I need to indicate "sort arrows".
    I would like to integrate such thing as a default in-built feature to reduce code lines on form level etc.
    Any suggestions how to look like and integration?
    I thought maybe with a .ColSortArrow property with enums None, Up and Down.
    But how to draw, default or app should provide picture? How to align? (Text truncate problem?)

    Thanks

  8. #328

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    The 'DataSource' property for reading ADO recordsets is now much faster reading the data.

    Instead of looping trough all records/fields, the .GetRows method is used to extract all into an array.

    In addition the cursor position does not need to be modified anymore as 'adBookmarkFirst' is used on .GetRows method.
    Last edited by Krool; Dec 23rd, 2019 at 12:56 PM.

  9. #329

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Updated released. (also for OCX)

    No VTable subclassing anymore at all. VTableSubclass.cls got removed.

  10. #330

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    OCX 1.4 released.

    Both versions are now in sync. (Std-EXE)

  11. #331
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,083

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Updated released. (also for OCX)

    No VTable subclassing anymore at all. VTableSubclass.cls got removed.
    Hi Krool, Could you explain why the new subclassing is better?

  12. #332
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,997

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by dreammanor View Post
    Hi Krool, Could you explain why the new subclassing is better?
    Hello, the explanation is in post # 2472 of the CCR thread.

  13. #333

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Bugfix in the ShowLabelTips property.

    That property is intended to show tooltips on folded cells. However, it didn't show on fixed cells even though it was designed to work also on fixed cells.
    The small bug was in the internal GetLabelInfo function.

  14. #334
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I am using this grid in a program where I need to format (color) certain words in a cell (but not all). Possible? (I started a thread in VB6 And Earlier about (erroneously) RTBs.)

  15. #335

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Stupid bugfix in the internal MoveNextRow and MoveNextCol function. It could malfunction on a filtered grid and on the last row/col.

  16. #336
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi Krool,
    I'm binding VBFlexGrid to sqlite database
    Code:
    Set VBFlexGrid1.FlexDataSource = DataSource.BindTo(Rs)
    However it is Impossile to sort columns order
    I got a message: This funtionality is disabled when custom datasource is set
    is there a work around?
    thanks

  17. #337

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by newbie2 View Post
    Hi Krool,
    I'm binding VBFlexGrid to sqlite database
    Code:
    Set VBFlexGrid1.FlexDataSource = DataSource.BindTo(Rs)
    However it is Impossile to sort columns order
    I got a message: This funtionality is disabled when custom datasource is set
    is there a work around?
    thanks
    The error says "functionality is disabled".
    Reason is crystal clear as you have a virtual binding to a sqlite recordset.
    If you want sorting - fine. Just append a "ORDER BY ..." in your sqlite SELECT statement.

  18. #338
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    The error says "functionality is disabled".
    Reason is crystal clear as you have a virtual binding to a sqlite recordset.
    If you want sorting - fine. Just append a "ORDER BY ..." in your sqlite SELECT statement.
    Thank you.
    In fact I need to sort them after having fed the flexgrid control.
    I have two command buttons.
    one is
    Code:
    VBFlexGrid1.Sort = FlexSortGenericAscending
    and the other is VBFlexGrid1.Sort = FlexSortGenericDescending

  19. #339

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by newbie2 View Post
    Thank you.
    In fact I need to sort them after having fed the flexgrid control.
    I have two command buttons.
    one is
    Code:
    VBFlexGrid1.Sort = FlexSortGenericAscending
    and the other is VBFlexGrid1.Sort = FlexSortGenericDescending
    In virtual bindig the grid is never fed. It just reads the data needed for the current view.

    When you need to sort after binding then re-fetch the data again in your custom data source (SELECT statement with ORDER BY) and make a .Refresh on the VBFlexGrid so it reads the new current view.

  20. #340
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    very clear
    thank you Krool

  21. #341
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    very clear
    thank you Krool

  22. #342
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Krool
    Sorry to bother you again
    Does VBFlexGrid support checkbox?
    I need to delete multiple records from VBFlexGrid
    thank you

  23. #343

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by newbie2 View Post
    Krool
    Sorry to bother you again
    Does VBFlexGrid support checkbox?
    I need to delete multiple records from VBFlexGrid
    thank you
    http://www.vbforums.com/showthread.p...-in-MsFlexGrid

  24. #344
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    thanks again
    I tested the two methods in the link provided but unluckily none of them succeeded
    One method is not possible with virtual binding
    And the the other method failed because VBFlexGrid seems not supporting CellPicture property.

    Edit
    I jus noticed in your Demo that CellPicture property is supported but in the sample demo provided in the link I get Method or Data member not found in the line
    Code:
     if VBFlexGrid1.CellPicture = picChecked then
    Last edited by newbie2; Apr 8th, 2020 at 06:19 PM.

  25. #345

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by newbie2 View Post
    thanks again
    I tested the two methods in the link provided but unluckily none of them succeeded
    One method is not possible with virtual binding
    And the the other method failed because VBFlexGrid seems not supporting CellPicture property.

    Edit
    I jus noticed in your Demo that CellPicture property is supported but in the sample demo provided in the link I get Method or Data member not found in the line
    Code:
     if VBFlexGrid1.CellPicture = picChecked then
    I cannot reproduce your error. Please provide a demo.
    I also recommend you to set CellPictureAlignment to 'FlexPictureAlignmentLeftCenterNoOverlap'.

  26. #346
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    I cannot reproduce your error. Please provide a demo.
    I also recommend you to set CellPictureAlignment to 'FlexPictureAlignmentLeftCenterNoOverlap'.
    Hello Krool
    Here is the demo
    I should note that with the MSFlexGrid control doesn't throw the error
    Attached Files Attached Files
    Last edited by newbie2; Apr 9th, 2020 at 08:07 AM.

  27. #347

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by newbie2 View Post
    Here is the demo
    I should note that with the MSFlexGrid control doesn't throw the error
    Thanks. I found the error.. Update released.

    In the internal structure the cell picture is stored as 'IPictureDisp'.
    However, somehow I exposed the cell picture back to the outside as 'IPicture'. (.CellPicture property)
    And that 'IPicture' is not "comparable" via "If Pic1 = Pic2 Then".

    I also updated the OCX version. Even as it was a "technical compatibility break" I choosed the "Preserve Compatibility (Advanced)" option.
    Because in "real" it's not a compatibility break. Any app will continue to run as before.

    So I encourage you to upgrade your 1.3 OCX you are currently using to the 1.4 OCX. (because 1.3 is not maintaned anymore)

    If you want to stick with the 1.3 version there is this little workaround you can do:
    Code:
    Dim CellPic As IPictureDisp
    Set CellPic = VBFlexGrid1.CellPicture
    If CellPic = picChecked Then
    If you go to 1.4 the above workaround is not necessary anymore. There you can do directly:
    Code:
    If VBFlexGrid1.CellPicture = picChecked Then

  28. #348
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thank you Krool for all these efforts you are doing.
    I registrered the 1.4 OCX . I could avoid the error but
    i still can't check / uncheck as I do with the MsFlexGrid.
    I attached the wo demos. one is working fine with the MsFlexGrid and the other is not working as expected with the VBFlexGrid
    Thank you
    Attached Files Attached Files

  29. #349
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I'm sorry
    I should have set the VBFlexGrid in the control property to: Col = 1 Row = 1 FixedRows and Cols = 0
    But something very strange is happening with virtual binding
    I'm getting type mismatch error in
    Code:
    Set VBFlexGrid1.FlexDataSource = DataSource.BindTo(Rs)
    When I drop version 1.4 and place Version 1.3, everything is OK
    Last edited by newbie2; Apr 9th, 2020 at 05:56 PM.

  30. #350

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by newbie2 View Post
    I'm sorry
    I should have set the VBFlexGrid in the control property to: Col = 1 Row = 1 FixedRows and Cols = 0
    But something very strange is happening with virtual binding
    I'm getting type mismatch error in
    Code:
    Set VBFlexGrid1.FlexDataSource = DataSource.BindTo(Rs)
    When I drop version 1.4 and place Version 1.3, everything is OK
    You need to change in your DataSource class the reference from IVBFlexDataSource from 1.3 to 1.4.

  31. #351
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    You need to change in your DataSource class the reference from IVBFlexDataSource from 1.3 to 1.4.
    There is no reference to the control version in the class
    Code:
    Option Explicit
    
    Implements IVBFlexDataSource
    Private mRs As cRecordset
    
    'a Public Method, to allow Binding to an outside DataSource (in this case an SQLite-cRecordset)
    Public Function BindTo(Rs As cRecordset) As IVBFlexDataSource
      Set mRs = Rs
      Set BindTo = Me 'return a reference of our Class-instance to the outside
    End Function
    
    'and the whole interface-implementation, which works against our internal SQLite-Recordset
    Private Function IVBFlexDataSource_GetRecordCount() As Long
      IVBFlexDataSource_GetRecordCount = mRs.RecordCount
    End Function
    Private Function IVBFlexDataSource_GetFieldCount() As Long
      IVBFlexDataSource_GetFieldCount = mRs.Fields.Count
    End Function
    Private Function IVBFlexDataSource_GetFieldName(ByVal Field As Long) As String
      IVBFlexDataSource_GetFieldName = mRs.Fields(Field).Name
    End Function
    Private Function IVBFlexDataSource_GetData(ByVal Field As Long, ByVal Record As Long) As String
      IVBFlexDataSource_GetData = mRs.ValueMatrix(Record, Field)
    End Function
    Private Sub IVBFlexDataSource_SetData(ByVal Field As Long, ByVal Record As Long, ByVal NewData As String)
      mRs.ValueMatrix(Record, Field) = NewData
    End Sub

  32. #352

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by newbie2 View Post
    There is no reference to the control version in the class
    Code:
    Option Explicit
    
    Implements IVBFlexDataSource
    Private mRs As cRecordset
    
    'a Public Method, to allow Binding to an outside DataSource (in this case an SQLite-cRecordset)
    Public Function BindTo(Rs As cRecordset) As IVBFlexDataSource
      Set mRs = Rs
      Set BindTo = Me 'return a reference of our Class-instance to the outside
    End Function
    
    'and the whole interface-implementation, which works against our internal SQLite-Recordset
    Private Function IVBFlexDataSource_GetRecordCount() As Long
      IVBFlexDataSource_GetRecordCount = mRs.RecordCount
    End Function
    Private Function IVBFlexDataSource_GetFieldCount() As Long
      IVBFlexDataSource_GetFieldCount = mRs.Fields.Count
    End Function
    Private Function IVBFlexDataSource_GetFieldName(ByVal Field As Long) As String
      IVBFlexDataSource_GetFieldName = mRs.Fields(Field).Name
    End Function
    Private Function IVBFlexDataSource_GetData(ByVal Field As Long, ByVal Record As Long) As String
      IVBFlexDataSource_GetData = mRs.ValueMatrix(Record, Field)
    End Function
    Private Sub IVBFlexDataSource_SetData(ByVal Field As Long, ByVal Record As Long, ByVal NewData As String)
      mRs.ValueMatrix(Record, Field) = NewData
    End Sub
    Does your vbp file references both 1.3 and 1.4?

  33. #353
    Fanatic Member
    Join Date
    Nov 2015
    Posts
    916

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Does your vbp file references both 1.3 and 1.4?
    yes it does
    Now I removed the reference to 1.3 and it worked
    thank you a lot
    Last edited by newbie2; Apr 10th, 2020 at 07:28 AM.

  34. #354
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hello

    I need this selection rule by mouse or keyboard:

    a)
    single click into cell = single cell selected
    mouse down and drag = select cells in the column (!) only, same for shift+cursor

    b)
    click on fixed row's cell
    select the whole column

    I already tried different combinations of the selection-related properties.
    And couldn't find a combination.

    What can I do to get the desired selection "mode"?

    Thank you
    Karl

  35. #355

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Karl77 View Post
    b)
    click on fixed row's cell
    select the whole column
    You need to have the .AllowBigSelection set to True. Then a click on a fixed row's cell automatically selects the whole column.

    Quote Originally Posted by Karl77 View Post
    a)
    single click into cell = single cell selected
    mouse down and drag = select cells in the column (!) only, same for shift+cursor
    To restrict a "mouse selection dragging" only to the current column you can use following code sample:

    Code:
    Private LButtonPressed As Boolean
    
    Private Sub VBFlexGrid1_BeforeSelChange(ByVal NewRowSel As Long, ByVal NewColSel As Long, Cancel As Boolean)
    If LButtonPressed = True Then
        If NewColSel <> VBFlexGrid1.ColSel Then Cancel = True
    End If
    End Sub
    
    Private Sub VBFlexGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then LButtonPressed = True
    End Sub
    
    Private Sub VBFlexGrid1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    LButtonPressed = False
    End Sub
    The extension to include also shift+cursor would look like:
    Code:
    Private LButtonPressed As Boolean
    Private ShiftPressed As Boolean
    
    Private Sub VBFlexGrid1_BeforeSelChange(ByVal NewRowSel As Long, ByVal NewColSel As Long, Cancel As Boolean)
    If LButtonPressed = True Or ShiftPressed = True Then
        If NewColSel <> VBFlexGrid1.ColSel Then Cancel = True
    End If
    End Sub
    
    Private Sub VBFlexGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
    ShiftPressed = CBool((Shift And vbShiftMask) <> 0)
    End Sub
    
    Private Sub VBFlexGrid1_KeyUp(KeyCode As Integer, Shift As Integer)
    ShiftPressed = CBool((Shift And vbShiftMask) <> 0)
    End Sub
    
    Private Sub VBFlexGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then LButtonPressed = True
    End Sub
    
    Private Sub VBFlexGrid1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    LButtonPressed = False
    End Sub
    Last edited by Krool; Apr 15th, 2020 at 01:16 PM.

  36. #356
    Fanatic Member
    Join Date
    Apr 2015
    Posts
    524

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    You need to have the .AllowBigSelection set to True. Then a click on a fixed row's cell automatically selects the whole column.
    Yes, I knew, I mentioned it only because I didn't want to lose this functionality along with the new 'mode'.

    To restrict a "mouse selection dragging" only to the current column you can use following code sample:

    The extension to include also shift+cursor would look like:
    Code:
    Private LButtonPressed As Boolean
    Private ShiftPressed As Boolean
    
    Private Sub VBFlexGrid1_BeforeSelChange(ByVal NewRowSel As Long, ByVal NewColSel As Long, Cancel As Boolean)
    If LButtonPressed = True Or ShiftPressed = True Then
        If NewColSel <> VBFlexGrid1.ColSel Then Cancel = True
    End If
    End Sub
    
    Private Sub VBFlexGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
    ShiftPressed = CBool((Shift And vbShiftMask) <> 0)
    End Sub
    
    Private Sub VBFlexGrid1_KeyUp(KeyCode As Integer, Shift As Integer)
    ShiftPressed = CBool((Shift And vbShiftMask) <> 0)
    End Sub
    
    Private Sub VBFlexGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then LButtonPressed = True
    End Sub
    
    Private Sub VBFlexGrid1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    LButtonPressed = False
    End Sub
    Works exactly as expected.
    Thanks for you support Krool.

  37. #357
    New Member
    Join Date
    Sep 2019
    Posts
    2

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thank you for this great grid.
    I found a bug in the latest version. If I set SelectionMode to any other value then Free and I have AllowUserEdit set to True, with a double click, I can only edit the first cell in the row or column and not the cell I double clicked.

    And there is one property missing. There is now BackgoundColorAlt, but no ForegroundColorAlt.

  38. #358

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by 0xDEADC0DE55 View Post
    Thank you for this great grid.
    I found a bug in the latest version. If I set SelectionMode to any other value then Free and I have AllowUserEdit set to True, with a double click, I can only edit the first cell in the row or column and not the cell I double clicked.

    And there is one property missing. There is now BackgoundColorAlt, but no ForegroundColorAlt.
    It's not a bug, it's a feature.

    For SelectionMode Free, FreeByRow, FreeByCol it works as you desire.
    For ByRow and ByCol it takes the first cell at it is the "focused" cell.
    You can change behavior by code at the BeforeEdit event.
    Check the "Reason" param for FlexEditReasonDblClick and as the Row and Col param in the event are "ByRef" you can make a .HitTest and apply .HitRow and .HitCol to it. (Or more convenient use .MouseRow and .MouseCol)
    Everyone has different desires, therefore there is a strict flat default behavior and such extra things need to be done via code.
    Last edited by Krool; May 9th, 2020 at 02:11 AM.

  39. #359

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Significant performance boost for the drawing operation.

    ~2% for
    Usage of Polyline API (not PolylineTo !) instead of MoveToEx and LineTo. (for the grid lines)
    Polyline is at device driver level, thus faster than LineTo and it doesn't change current position.

    ~1% for
    Usage of PatBlt API instead of FillRect. (FillRect is a wrapper of PatBlt SelectObject'ing the specified Brush)
    Of course when each cell has a different backcolor the effect is equal to FillRect.

    ~5% for
    Preserving the memory DC & Bitmap (DoubleBuffer) for WM_PAINT and purge only upon WM_SIZE. (and cleanup on destroy window)

  40. #360
    Fanatic Member
    Join Date
    Mar 2010
    Posts
    762

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I just downloaded the package (VBFlexGridDemo.zip) attached to post #1

    There is no ocx file in it.

Page 9 of 34 FirstFirst ... 678910111219 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width