Page 18 of 34 FirstFirst ... 81516171819202128 ... LastLast
Results 681 to 720 of 1321

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #681
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    597

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Update released. Included the ComboCueRow/ComboCueCol property which lets you determine where to display the combo cue.

    It's possible to reset the ComboCueRow/ComboCueCol to -1 so that it is always the current focused cell. (equal .Row/.Col)

    To have this "hot-tracking" behavior. Ensure VBFlexGrid.MouseTrack is True and have following code.
    Code:
    Private Sub VBFlexGrid1_MouseLeave()
    VBFlexGrid1.ComboCue = FlexComboCueNone
    VBFlexGrid1.ComboCueRow = -1
    VBFlexGrid1.ComboCueCol = -1
    End Sub
    
    Private Sub VBFlexGrid1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    VBFlexGrid1.HitTest X, Y
    If VBFlexGrid1.HitResult = FlexHitResultNoWhere Then
        VBFlexGrid1.ComboCue = FlexComboCueNone
        VBFlexGrid1.ComboCueRow = -1
        VBFlexGrid1.ComboCueCol = -1
        Exit Sub
    End If
    If VBFlexGrid1.HitRow >= VBFlexGrid1.FixedRows Then
        Select Case VBFlexGrid1.HitCol
            Case COL_CALENDARVALIDATION, COL_COMBODROPDOWN, COL_COMBOEDITABLE
                VBFlexGrid1.ComboCue = FlexComboCueDropDown
                VBFlexGrid1.ComboCueRow = VBFlexGrid1.HitRow
                VBFlexGrid1.ComboCueCol = VBFlexGrid1.HitCol
            Case COL_COMBOBUTTON
                VBFlexGrid1.ComboCue = FlexComboCueButton
                VBFlexGrid1.ComboCueRow = VBFlexGrid1.HitRow
                VBFlexGrid1.ComboCueCol = VBFlexGrid1.HitCol
            Case Else
                VBFlexGrid1.ComboCue = FlexComboCueNone
                VBFlexGrid1.ComboCueRow = -1
                VBFlexGrid1.ComboCueCol = -1
        End Select
    Else
        VBFlexGrid1.ComboCue = FlexComboCueNone
        VBFlexGrid1.ComboCueRow = -1
        VBFlexGrid1.ComboCueCol = -1
    End If
    End Sub
    After picking a dropdown ComboBox item, focus goes to mouse Cell, should stay at last dropdown cell, logically.

  2. #682

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by DaveDavis View Post
    After picking a dropdown ComboBox item, focus goes to mouse Cell, should stay at last dropdown cell, logically.
    Easy to make. Use .ComboCue and .CellComboCue at the same time. See code below.

    Code:
    Private Sub VBFlexGrid1_RowColChange()
    Static LastRow As Long, LastCol As Long
    VBFlexGrid1.Cell(FlexCellComboCue, LastRow, LastCol) = FlexComboCueNone
    If VBFlexGrid1.Row >= VBFlexGrid1.FixedRows Then
        Select Case VBFlexGrid1.Col
            Case COL_CALENDARVALIDATION, COL_COMBODROPDOWN, COL_COMBOEDITABLE
                VBFlexGrid1.Cell(FlexCellComboCue, VBFlexGrid1.Row, VBFlexGrid1.Col) = FlexComboCueDropDown
            Case COL_COMBOBUTTON
                VBFlexGrid1.Cell(FlexCellComboCue, VBFlexGrid1.Row, VBFlexGrid1.Col) = FlexComboCueButton
            Case Else
                VBFlexGrid1.Cell(FlexCellComboCue, VBFlexGrid1.Row, VBFlexGrid1.Col) = FlexComboCueNone
        End Select
    Else
        VBFlexGrid1.Cell(FlexCellComboCue, VBFlexGrid1.Row, VBFlexGrid1.Col) = FlexComboCueNone
    End If
    LastRow = VBFlexGrid1.Row
    LastCol = VBFlexGrid1.Col
    End Sub
    
    Private Sub VBFlexGrid1_MouseLeave()
    VBFlexGrid1.ComboCue = FlexComboCueNone
    VBFlexGrid1.ComboCueRow = -1
    VBFlexGrid1.ComboCueCol = -1
    End Sub
    
    Private Sub VBFlexGrid1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    VBFlexGrid1.HitTest X, Y
    If VBFlexGrid1.HitResult = FlexHitResultNoWhere Then
        VBFlexGrid1.ComboCue = FlexComboCueNone
        VBFlexGrid1.ComboCueRow = -1
        VBFlexGrid1.ComboCueCol = -1
        Exit Sub
    End If
    If VBFlexGrid1.HitRow >= VBFlexGrid1.FixedRows Then
        Select Case VBFlexGrid1.HitCol
            Case COL_CALENDARVALIDATION, COL_COMBODROPDOWN, COL_COMBOEDITABLE
                VBFlexGrid1.ComboCue = FlexComboCueDropDown
                VBFlexGrid1.ComboCueRow = VBFlexGrid1.HitRow
                VBFlexGrid1.ComboCueCol = VBFlexGrid1.HitCol
            Case COL_COMBOBUTTON
                VBFlexGrid1.ComboCue = FlexComboCueButton
                VBFlexGrid1.ComboCueRow = VBFlexGrid1.HitRow
                VBFlexGrid1.ComboCueCol = VBFlexGrid1.HitCol
            Case Else
                VBFlexGrid1.ComboCue = FlexComboCueNone
                VBFlexGrid1.ComboCueRow = -1
                VBFlexGrid1.ComboCueCol = -1
        End Select
    Else
        VBFlexGrid1.ComboCue = FlexComboCueNone
        VBFlexGrid1.ComboCueRow = -1
        VBFlexGrid1.ComboCueCol = -1
    End If
    End Sub

  3. #683
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    597

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Easy to make. Use .ComboCue and .CellComboCue at the same time. See code below.

    Code:
    Private Sub VBFlexGrid1_RowColChange()
    Static LastRow As Long, LastCol As Long
    VBFlexGrid1.Cell(FlexCellComboCue, LastRow, LastCol) = FlexComboCueNone
    If VBFlexGrid1.Row >= VBFlexGrid1.FixedRows Then
        Select Case VBFlexGrid1.Col
            Case COL_CALENDARVALIDATION, COL_COMBODROPDOWN, COL_COMBOEDITABLE
                VBFlexGrid1.Cell(FlexCellComboCue, VBFlexGrid1.Row, VBFlexGrid1.Col) = FlexComboCueDropDown
            Case COL_COMBOBUTTON
                VBFlexGrid1.Cell(FlexCellComboCue, VBFlexGrid1.Row, VBFlexGrid1.Col) = FlexComboCueButton
            Case Else
                VBFlexGrid1.Cell(FlexCellComboCue, VBFlexGrid1.Row, VBFlexGrid1.Col) = FlexComboCueNone
        End Select
    Else
        VBFlexGrid1.Cell(FlexCellComboCue, VBFlexGrid1.Row, VBFlexGrid1.Col) = FlexComboCueNone
    End If
    LastRow = VBFlexGrid1.Row
    LastCol = VBFlexGrid1.Col
    End Sub
    
    Private Sub VBFlexGrid1_MouseLeave()
    VBFlexGrid1.ComboCue = FlexComboCueNone
    VBFlexGrid1.ComboCueRow = -1
    VBFlexGrid1.ComboCueCol = -1
    End Sub
    
    Private Sub VBFlexGrid1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    VBFlexGrid1.HitTest X, Y
    If VBFlexGrid1.HitResult = FlexHitResultNoWhere Then
        VBFlexGrid1.ComboCue = FlexComboCueNone
        VBFlexGrid1.ComboCueRow = -1
        VBFlexGrid1.ComboCueCol = -1
        Exit Sub
    End If
    If VBFlexGrid1.HitRow >= VBFlexGrid1.FixedRows Then
        Select Case VBFlexGrid1.HitCol
            Case COL_CALENDARVALIDATION, COL_COMBODROPDOWN, COL_COMBOEDITABLE
                VBFlexGrid1.ComboCue = FlexComboCueDropDown
                VBFlexGrid1.ComboCueRow = VBFlexGrid1.HitRow
                VBFlexGrid1.ComboCueCol = VBFlexGrid1.HitCol
            Case COL_COMBOBUTTON
                VBFlexGrid1.ComboCue = FlexComboCueButton
                VBFlexGrid1.ComboCueRow = VBFlexGrid1.HitRow
                VBFlexGrid1.ComboCueCol = VBFlexGrid1.HitCol
            Case Else
                VBFlexGrid1.ComboCue = FlexComboCueNone
                VBFlexGrid1.ComboCueRow = -1
                VBFlexGrid1.ComboCueCol = -1
        End Select
    Else
        VBFlexGrid1.ComboCue = FlexComboCueNone
        VBFlexGrid1.ComboCueRow = -1
        VBFlexGrid1.ComboCueCol = -1
    End If
    End Sub
    Yes. work as EXPECT. The hot tracking cue will shift to new mouse-on cell after selection, not the current editing cell because mouse is no more on last editing cell...It could confuse user on which is last editing cell.
    IMO, keep cue indication is an another option, I prefer.
    Attached Images Attached Images  

  4. #684
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Experimental feature 'AllowUserFreezing'.

    Please test and report any behavior mismatch or suggestions.

    After feedback it will be integrated into the current version.

    Thanks
    Thanks for this easy mode of freezing rows and/or columns. I tried each of the 'AllowUserFreezing' values (0 to 3) and all of them performed as expected.

    Kind regards.

  5. #685
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Dear Krool,

    The fixed ComboCue (and DynamicCue on MouseMove too) is visible only if 'AllowUserEditing' is true. Is it possible to have fixed ComboCue visible even if 'AllowUserEditing' is false? Or, is it possible to have AllowUserEditing for a particular column alone?

    Actually, in my grid, I want to allow only one column's cells (say 1st column's) to be editable by user. All other columns are non-editable. So, I want to keep 'AllowUserEditing' false and when 1st column cell is clicked, write my own processing code starting with ".StartEdit". But, I want the fixed ComboCue to be visible even before the 1st column cell is clicked. Also, in MouseMove event of 1st column, I want the ComboCues to be shown in the cells of the 1st column (i.e. even when 'AllowUserEditing' is false). Possible?

    If not possible, as of now, then what is the best way to allow editing only in 1st column cells and disallow editing in all other columns' cells?

    As of now, what I am doing is keeping 'AllowUserEditing' true (so that the ComboCues - both fixed and dynamic - show up normally) and when double-click happens on other columns' cells, I issue a .CancelEdit as follows.

    Code:
    Private Sub flx2_EnterEdit()
      
      If flx2.Col <> 1 Then
        flx2.CancelEdit
      End If
      
    End Sub
    One problem with the above way to disallow editing is that the blue highlight shows up for a micro second, when I double-click on a cell.

    1) Is there a "better" way to achieve what I require (than what I am doing)? I feel that there must be surely a better way out.
    2) In case if my method is the way out, then how to avoid the blue highlighting for a microsecond? Not a major issue for me but just wish to know if it can be avoided.

    Kind regards.
    Last edited by softv; Nov 5th, 2021 at 10:53 AM.

  6. #686
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Is there also a BeforeEdit event in which you can cancel the input for given cells?

  7. #687

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Yes, use the BeforeEdit event. Check Row/Col and set Cancel to True to avoid that the edit will be initiated at all.

  8. #688

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    AllowUserFreezing property now included.

    Also the new AfterUserFreeze event fires after a user changed the number of frozen rows or columns.
    A BeforeUserFreeze event is not included as it makes no sense. There is only 1 solid line for either frozen rows or columns.
    So a cancelling is not meaningful as just setting AllowUserFreezing to Row only, Column only or Both is enough.

    Included the new AfterUserResizeEnd event.
    The AfterUserResize event has a ByRef NewSize As Long parameter where the app can influence the width/height that will be committed. (like in the ListView control)
    However, it may be necessary to synchronize something after the new width/height got applied. This is now where the AfterUserResizeEnd fires.
    Last edited by Krool; Nov 10th, 2021 at 09:51 AM.

  9. #689

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    The escape key now cancels any ongoing divider drag operation.

    This change will also be applied to the (yet already outdated) VBFLXGRD14.OCX.

  10. #690
    Member
    Join Date
    Apr 2021
    Posts
    44

    Post Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Update released.

    The escape key now cancels any ongoing divider drag operation.

    This change will also be applied to the (yet already outdated) VBFLXGRD14.OCX.
    Thanks Krool, what I was wondering is how to do a Drag and Drop per column, also implement the same (per row and column) to another vbflexgrid (from vbFlexgrid1 to VbFlexgrid2)

  11. #691

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Dumb bug fixed.

    SB_PAGE* scrolling now working propertly! (regression since 08-Sep-2021)

    This affects mouse scrolling on the scrollbar only. (not page up/down keys)

  12. #692

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Included the AllowScrollLock property.

    When the scroll lock key is toggled on it allows the user to use the arrow keys to scroll.
    The new property defaults to False to not break compatibility or causing surprises by an accidently activate scroll lock.
    Also the "overhead" of checking the toggled state for vbKeyScrollLock on all arrows keys input is only when AllowScrollLock is set to True.

    The behavior is like in Excel, means arrows keys with..
    .. shift state 0 and ctrl state 0 will scroll like a SB_LINE*
    .. shift state <> 0 and ctrl state 0 will do nothing.
    .. shift state 0 and ctrl state <> 0 will scroll like a SB_PAGE*
    .. shift state <> 0 and ctrl state <> 0 will behave normal

  13. #693
    Lively Member
    Join Date
    Oct 2016
    Posts
    108

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi! Krool,

    your Grid control seems to be better then the ComponentOne grid control, however ComponentOne has the facility to print and save as pdf their control with the vsPrinter and vsPDF8 control.

    Also SelectionMode has an option SelectionListBox (so when allowselection = false, the control will work a bit like a listbox, where you can select one row at a time. etc..)

    do you have any plans of producing something like that.
    Last edited by Semke; Nov 11th, 2021 at 08:56 PM.

  14. #694
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Included the AllowScrollLock property.

    When the scroll lock key is toggled on it allows the user to use the arrow keys to scroll.
    The new property defaults to False to not break compatibility or causing surprises by an accidently activate scroll lock.
    Also the "overhead" of checking the toggled state for vbKeyScrollLock on all arrows keys input is only when AllowScrollLock is set to True.

    The behavior is like in Excel, means arrows keys with..
    .. shift state 0 and ctrl state 0 will scroll like a SB_LINE*
    .. shift state <> 0 and ctrl state 0 will do nothing.
    .. shift state 0 and ctrl state <> 0 will scroll like a SB_PAGE*
    .. shift state <> 0 and ctrl state <> 0 will behave normal
    Thanks krool for this nice add-on feature.

    Kind regards.

  15. #695

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Semke View Post
    Also SelectionMode has an option SelectionListBox (so when allowselection = false, the control will work a bit like a listbox, where you can select one row at a time. etc..)
    Yes, that's planned. (Multi-selection on rows)
    The idea is to have a selected state bit for a row. (RWIS_SELECTED)
    This comes along then with a RowSelected r/w property and read only SelectedRow/SelectedRows property. (For enum like in vsFlexGrid)

    What I'm not sure if I should add a selection mode ListBox/FreeListBox or have another boolean property "MultiSelect" which is only allowed for selection modes ByRow/FreeByRow.
    This would keep a possibility open for CLIS_SELECTED maybe. (Multi select columns)
    ..

  16. #696

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    removed
    Last edited by Krool; Nov 13th, 2021 at 03:12 PM.

  17. #697

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included the AllowMultiSelection property. This property can only be set to True for SelectionMode 1 - ByRow or 3 - FreeByRow.

    Included the RowSelected/SelectedRow/SelectedRows run-time property. These are automatically set when AllowMultiSelection is set to True.
    However, they can be set by code even when AllowMultiSelection is set to False.

    Improved AllowSelection property (when set to False) to not restrict..
    - ColSel for SelectionMode 1 - ByRow
    - RowSel for SelectionMode 2 - ByColumn

    To note is that AllowMultiSelection and AllowSelection property are working together and do not restrict each other.
    So, in fact it is a legal behavior to have AllowSelection = False and AllowMultiSelection = True.

    EDIT:
    Below an example to enumerate the selected rows. There are two possible ways.

    #1
    Code:
    For i = 0 To VBFlexGrid1.Rows - 1
        If VBFlexGrid1.RowSelected(i) = True Then
            Debug.Print "Row: " & i
        End If
    Next i
    #2
    Code:
    Dim i As Long
    For i = 0 To VBFlexGrid1.SelectedRows - 1
        Debug.Print "Row: " & VBFlexGrid1.SelectedRow(i)
    Next i
    Last edited by Krool; Nov 17th, 2021 at 03:57 AM.

  18. #698

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Included enum FlexFocusRectFlat for the FocusRect property.
    It draws a solid rectangle (BackColorSel) instead of using the DrawFocusRect API.

    Name:  FlexFocusRectFlat.png
Views: 972
Size:  1.3 KB

    The border width is determined by the GridLineWidth property and not by influenced by SPI_GETFOCUSBORDERWIDTH/SPI_GETFOCUSBORDERHEIGHT.

  19. #699

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    When there are no frozen rows/cols (yet) and there are also no fixed rows/cols the user was not able to "UserFreeze" (AllowUserFreezing = True)

    This has been fixed now.

  20. #700

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Open question:

    When GridLines are None or Raised the focus rect is in either case 1 pixel off. That's the same behavior as in MS(H)FlexGrid.
    Shall this be fixed? (Not only focus rect, also in-place editing affected)
    If yes, silent fix or by another property?

  21. #701
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Open question:

    When GridLines are None or Raised the focus rect is in either case 1 pixel off. That's the same behavior as in MS(H)FlexGrid.
    Shall this be fixed? (Not only focus rect, also in-place editing affected)
    If yes, silent fix or by another property?
    Personally, I'd like to see you leave it exactly the same as the Microsoft version. Or, if you do fix it, fix it with an option, possibly with a True/False property that's named something like FixGridLinesOffset, and have it default to False.

    And here's one rationale for that. I personally have custom controls that use the MSFlexGrid that have overlay textboxes and comboboxes for data entry. If/When I completely switch to your controls, I'd like to be able to do it with a straightforward "drop in", with no tweaking whatsoever.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  22. #702

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included the SheetBorder property.
    The default value is True which draws a border around the sheet. (Like MSFlexGrid)
    When set to False it draws no such border. (Like MSHFlexGrid)

    In vsFlexGrid this 'SheetBorder' specifies just a color, here a boolean.
    I found it important to keep full compatibility with MSFlexGrid. Therefore it can't be a color, as the MSFlexGrid uses the fixed pen. (GridColorFixed)

    And in vsFlexGrid to have "no border" the dev should set SheetBorder and BackColorBkg to the same color.
    Here with the boolean it's truly no border and to behave like a MSHFlexGrid control.

    Side question:
    Is there a need to customize the appearance of the freeze pane borderlines? (E.g. GridLinesFrozen, GridColorFrozen)
    Here I could enhance as no compatibility issue..
    Currently it just uses the fixed pen.

  23. #703
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Is there a need to customize the appearance of the freeze pane borderlines? (E.g. GridLinesFrozen, GridColorFrozen)
    Here I could enhance as no compatibility issue..
    Currently it just uses the fixed pen.
    Personally, I'll take all the options I can get. I already subclass the MS ListView to make it do several things it doesn't natively do ... specifically related to the color of things. I don't use MSFlexGrid nearly as much as I use ListView, but I do use it. The more options (especially in terms of style and colors), always the better.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  24. #704

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Quote Originally Posted by Elroy View Post
    Personally, I'll take all the options I can get. I already subclass the MS ListView to make it do several things it doesn't natively do ... specifically related to the color of things. I don't use MSFlexGrid nearly as much as I use ListView, but I do use it. The more options (especially in terms of style and colors), always the better.
    Thank you. Done. (GridColorFrozen/GridLinesFrozen/GridLineWidthFrozen)

  25. #705

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    EDIT:

    The FocusRectWidth property has now a default value of -1, which exposes SPI_GETFOCUSBORDERWIDTH in that case. (affects only FlexFocusRectFlat)
    Last edited by Krool; Nov 28th, 2021 at 03:20 AM.

  26. #706
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Another question:

    FocusRectWidth property is recently added for FlexFocusRectFlat.

    That FocusRectWidth has a default value of 1 currently.

    What about changing the default value to -1 and exposing either SPI_GETFOCUSBORDERHEIGHT or SPI_GETFOCUSBORDERWIDTH in that case ? (Either the higher or lesser of these two)
    That's getting pretty esoteric for me ... and I'm not sure I've got an opinion at this time. I certainly don't currently use the FocusRectWidth property, so I've got no opinion on changing how that behaves. I've certainly got no objection to exposing some read-only properties.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  27. #707

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Elroy View Post
    I certainly don't currently use the FocusRectWidth property, so I've got no opinion on changing how that behaves.
    Nevermind.
    Last edited by Krool; Nov 28th, 2021 at 03:19 AM.

  28. #708

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Bugfix in the internal DrawGrid routine. Merged rows/cols were just discarded partially in the freezing pane.
    This is now fixed.

  29. #709

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Elroy View Post
    Personally, I'd like to see you leave it exactly the same as the Microsoft version. Or, if you do fix it, fix it with an option, possibly with a True/False property that's named something like FixGridLinesOffset, and have it default to False.

    And here's one rationale for that. I personally have custom controls that use the MSFlexGrid that have overlay textboxes and comboboxes for data entry. If/When I completely switch to your controls, I'd like to be able to do it with a straightforward "drop in", with no tweaking whatsoever.
    I don't see a compatibility break, just a visual difference.

    I just released an update so that all places take the offsets now from a central routine to make this more transparent.
    Code:
    Private Sub GetGridLineOffsets(ByVal iRow As Long, ByVal iCol As Long, ByRef GridLineOffsets As TGRIDLINEOFFSETS)
    ' The grid line offsets in MS(H)FlexGrid are hard-coded for all scenarios as per below values.
    ' However, in future these could be fixed by an opt-in property to get the correct values.
    GridLineOffsets.LeftTop.CX = 0
    GridLineOffsets.LeftTop.CY = 0
    GridLineOffsets.RightBottom.CX = 1
    GridLineOffsets.RightBottom.CY = 1
    End Sub
    Currently these are the values to be "visual compatible" with the MS(H)FlexGrid.

    However, fixing this in future with an "FixGridLineOffsets" is perhaps the best idea.

  30. #710
    Hyperactive Member Daniel Duta's Avatar
    Join Date
    Feb 2011
    Location
    Bucharest, Romania
    Posts
    396

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Arnoutdv View Post
    Is there also a BeforeEdit event in which you can cancel the input for given cells?
    I know you've been using the vsflexgrid for a long time and you have a good knowledge of its functionality in terms of events, methods and properties. I wonder to what extent this new control manages to reproduce the vsflexgrid features. Does this control allow you to merge cells, autosize rows and columns or other stuff such as Sort, BindToArray, GetMergedRange, LoadArray, SaveGrid etc. ? I am curious which is your opinion.
    "VB code is practically pseudocode" - Tanner Helland
    "When you do things right, people won't be sure you've done anything at all" - Matt Groening
    "If you wait until you are ready, it is almost certainly too late" - Seth Godin
    "Believe nothing you hear, and only one half that you see" - Edgar Allan Poe

  31. #711
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I've not replaced the vsFlexGrid by the vbFlexGrid. There is also no need for me, because the vsFlexGrid does what it needs to do.

    My experience with the vbFlexGrid is thus very limited.

  32. #712

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    FixGridLineOffsets property included. It defaults to False to match behavior of the MS(H)FlexGrid control.

    My own "todo" list is almost finished now so I may release OCX version 1.5 soon..

  33. #713
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Update released.

    FixGridLineOffsets property included. It defaults to False to match behavior of the MS(H)FlexGrid control.

    My own "todo" list is almost finished now so I may release OCX version 1.5 soon..
    Looking forward to 1.5, krool. Thanks a TON.

    Kind regards.

  34. #714

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    One open question. (concerning right-to-left)

    The Alignment enum FlexAlignmentGeneral says that numbers and dates are left-aligned and otherwise right-aligned.
    When RightToLeftLayout is True this is of course flipped.

    However, when only RightToLeft is True (and RightToLeftLayout is False, means only RTL-Reading) then it is up to the coder to either right or left align accordingly.
    But for FlexAlignmentGeneral there is no way to flip the alignment in that case.

    Should I include an 'FlexAlignmentGeneralMirror' enum to have a solution in that case ?

  35. #715

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    One open question. (concerning right-to-left)

    The Alignment enum FlexAlignmentGeneral says that numbers and dates are left-aligned and otherwise right-aligned.
    When RightToLeftLayout is True this is of course flipped.

    However, when only RightToLeft is True (and RightToLeftLayout is False, means only RTL-Reading) then it is up to the coder to either right or left align accordingly.
    But for FlexAlignmentGeneral there is no way to flip the alignment in that case.

    Should I include an 'FlexAlignmentGeneralMirror' enum to have a solution in that case ?
    I answer this to myself now.
    Having 2 General enums causes other issues.
    So I decided to include a new property 'MirrorAlignGeneral'.

  36. #716

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Included now ComboButtonAlignment/ColComboButtonAlignment property.
    This may be helpful for right-to-left properties. For RightToLeftLayout = True it should stay as 1 - Right as the mirror placement flips it anyway. So this is just a need for rtl reading only.

  37. #717

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    OCX 1.5 released.

  38. #718
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    OCX 1.5 released.
    Thanks a lot, Krool.

  39. #719
    Hyperactive Member
    Join Date
    Feb 2015
    Location
    Colorado USA
    Posts
    261

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I just updated the documentation and compile/update utility which now handles VBFLXGRDxx.OCX files up through the just-released v1.5 and VBCCRxx.OCX up through the current v1.7. It is located at the bottom of the post #1 in this thread.

  40. #720
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Dear all,

    Is it possible to bind (in some way or other) the VBFlexGrid to a database table so that as I scroll the grid, only the data pertaining to the visible rows get displayed in the VBFlexGrid? The other rows should not hold any data internally. Otherwise, I see (via task manager) that the memory used jumps up greatly. For my purposes, the non-visible rows not containing data is not an issue.


    In fact, if the rows of the grid can be always set and maintained to a fixed value, equal to the number of visible rows (say 30), but corresponding data can still be shown (from the database table) just for visible rows alone [with col(0) showing the varying row(record) number, say 31 to 60 or 1100 to 1029 or 329001 to 329030 or ... or ..., as user scrolls the grid] that is even more ideal since I see that even empty rows (without any data) occupy a chunk of memory.


    Of course, I can write code to achieve the above (I have some ideas on how to go about it) but just wanted to know whether any direct or a 'short and easy' method is already available so that I need not invest time to write my aforesaid code (which I think I might take some considerable time to develop, to get it running to perfection, since I am not anywhere near the experts like many of you here, to churn out the fastest and shortest codes, that too in so quick a time!, whenever the need arises).

    Thanks in advance.

    And, I take this opportunity to once again thank you Krool and all other great souls like you here in this Forum - Olaf and many more... God bless you all!


    Kind regards.

Page 18 of 34 FirstFirst ... 81516171819202128 ... 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