Page 36 of 36 FirstFirst ... 2633343536
Results 1,401 to 1,430 of 1430

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #1401

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included the ComboBoundColumn/ColComboBoundColumn run-time property. (zero-based integer)
    This defines the column which will be bound to the text box for the multi-column drop-down list.

    The default value is 0 which is the first column. The demo project uses the col lookup property to map Id's to Names.
    With this new functionality the drop-down list uses the second column (ColComboBoundColumn() = 1) and the first column display the Id's.

    Some improvement of the visualization:
    The un-bound columns have as text color gray (&H808080; like the ListView uses on Tile view for the subitems) and the lines between the columns have the color of the default grid color (&HC0C0C0).
    The bound column will have as text color vbWindowText. The header has vbButtonText and vbButtonFace as background.

    Name:  FlexComboBoundColumn.png
Views: 1037
Size:  5.7 KB
    Last edited by Krool; Jul 24th, 2024 at 11:48 AM.

  2. #1402
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    235

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    I responded to your question back in Oct 5th 2023 to workaround this by using SetWindowPos on the EditSetupWindow event.
    However, vsFlexGrid seems to increase the drop-down list width when the longest entry is wider then the cell width.

    Should VBFlexGrid maybe also here "automatically" make the width based on the cell width, and while inserting the items measure them and increase the drop-down list width, if necessary ?
    Or should we offer extra functions/properties to set these and react on an event ?
    Of course doing this by default would feel intuitively and standard behavior. Risk is here only to have an extreme wide drop-down list when there is a large entry...
    Thanks a TON for the new updates to the VBFlexGrid control based on the above, dear Krool.
    Multi-column drop-down (that too with headers) is fantastic! Great! Really Great!

    Kind Regards.
    Love is God. God is Love. As Ever, All Glory and Thanks to the Lord Almighty Only, Forever...

    "You say grace before meals. All right. But I say grace before the concert and the opera, and grace before the play and pantomime, and grace before I open a book, and grace before sketching, painting, swimming, fencing, boxing, walking, playing, dancing and grace before I dip the pen in the ink." - G. K. Chesterton

  3. #1403

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included the AlwaysAllowComboCues property with new ComboCueClick event.
    The combo cues can then be displayed always even when AllowUserEditing = False.
    The ComboCueClick event is fired when either AllowUserEditing = False or a user attempt to edit has been canceled.

    This new feature can be useful to define drop-down buttons on the header fixed row and to show a popup menu with options like sorting, filtering etc.
    That can be more intuitive then a right-click (context menu) on the header fixed row.. also it can free up the left mouse down button to select a column rather than sorting.

  4. #1404

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included the GetMetrics method which retrieves the metrics in twips of the flex grid control. (CX and CY)

    Below example shows to re-size cell to fit it's cell picture at minimum. (using FlexMetricCellSpacing)
    Best effect of course if the alignment of the cell picture is 'CenterCenter'.
    Code:
    If Not VBFlexGrid1.CellPicture Is Nothing Then
        Dim CX As Long, CY As Long
        VBFlexGrid1.GetMetrics FlexMetricCellSpacing, CX, CY
        With VBFlexGrid1.CellPicture
        CX = CX + Me.ScaleX(CHimetricToPixel_X(.Width), vbPixels, vbTwips)
        CY = CY + Me.ScaleY(CHimetricToPixel_X(.Height), vbPixels, vbTwips)
        End With
        If VBFlexGrid1.ColWidth(VBFlexGrid1.Col) < CX Then VBFlexGrid1.ColWidth(VBFlexGrid1.Col) = CX
        If VBFlexGrid1.RowHeight(VBFlexGrid1.Row) < CY Then VBFlexGrid1.RowHeight(VBFlexGrid1.Row) = CY
    End If
    Some explanations:
    FlexMetricDividerSpacing is the hit-test spacing between columns (CX) and rows (CY) for the divider. The spacing is applied 2x. (before and after column/row)
    FlexMetricCellSpacing is the overall extra spacing for a cell. CX for horizontal spacing and CY for vertical spacing.
    FlexMetricTextPadding is the padding inside the cell between the boundary of the cell and the text rectangle. The padding (CX and CY) are applied 2x, top/left and right/bottom.
    FlexMetricScrollBarSize is used for the combo drop-down button. Though the button width can be customized for ComboModeButton. CY not meaningful (returns the same as CX).
    FlexMetricCheckBoxSize is the check box rectangle. CX the width and CY the height. Though both are the same most likely.
    Last edited by Krool; Aug 8th, 2024 at 02:44 AM.

  5. #1405
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi all, i hope the holidays were fine for everyone :-)

    One question:

    How is the best way to (if it's possible) calculate the row height while editing ?

    I mean: user enters this in a cell: xxx + control&enter (chr10) + yyyy + control&enter + qqqq

    And he can't see the 3 lines because the rowheight.
    i just do an autosize at afteredit event, and it's just fine, but... when using for example at keyup event something like:

    Code:
    Private Sub GrFra_EditKeyUp(KeyCode As Integer, Shift As Integer)
    
        
        If KeyCode = 13 Then
            If GrFra.Rows > 1 Then
                GrFra.RowHeight(GrFra.Row) = GrFra.RowHeight(GrFra.Row) + 300    'random number just to see if it works
            End If
        End If   
    
    End Sub
    any idea about how to increase the rowheight in realtime ?
    it displays weird text (while user inputs).


    EDIT:

    i think i'm still on holidays xD,, just a.refresh after new rowheigt did the trick

    Thanks!
    Last edited by Calcu; Aug 28th, 2024 at 05:52 AM.

  6. #1406

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    Hi all, i hope the holidays were fine for everyone :-)

    One question:

    How is the best way to (if it's possible) calculate the row height while editing ?

    I mean: user enters this in a cell: xxx + control&enter (chr10) + yyyy + control&enter + qqqq

    And he can't see the 3 lines because the rowheight.
    i just do an autosize at afteredit event, and it's just fine, but... when using for example at keyup event something like:

    Code:
    Private Sub GrFra_EditKeyUp(KeyCode As Integer, Shift As Integer)
    
        
        If KeyCode = 13 Then
            If GrFra.Rows > 1 Then
                GrFra.RowHeight(GrFra.Row) = GrFra.RowHeight(GrFra.Row) + 300    'random number just to see if it works
            End If
        End If   
    
    End Sub
    any idea about how to increase the rowheight in realtime ?
    it displays weird text (while user inputs).


    EDIT:

    i think i'm still on holidays xD,, just a.refresh after new rowheigt did the trick

    Thanks!
    Glad you found out yourself.
    Yes, indeed it is intended to use .Refresh here as it will update the edit rectangle to new size.

  7. #1407
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi again!

    It should be so dificult to implement an undo / redo function ?

    i will try to write one for my textboxes, but i don't think it will work with vbflexgrid.

    I think a 10 or 15 times undo will be enough.

    Thanks again krool for this incredible grid.


    Edit:

    i created a little class:

    https://www.vbforums.com/showthread....ndo-Redo-Class


    It seems it works fine :-)
    Last edited by Calcu; Sep 1st, 2024 at 04:56 AM.

  8. #1408
    Lively Member
    Join Date
    Oct 2014
    Posts
    106

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hello Krool!
    The property of "AlwaysAllowComboCues" in VBFlexGridDemo has not been added to "VBFLXGRD17.ocx".
    Please do you have anything convenient to add.
    Thank you very much!

  9. #1409

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Thanks to Calcu for the idea to add undo / redo function.

    Included the Undo/Redo/ResetUndoQueue methods and CanUndo/CanRedo functions.
    This is useful for clip operations (Cut, Paste and Delete) and for user editing.
    Included the UndoLimit property which defaults to 0. (disabled feature)

    Please feel free to test the new functionality and give feedback what finetuning should be done.

    At the moment the UndoLimit is not restricted. Maybe we should define an upper limit ? Maybe 100 ?

    Also I added a new property page for the "Clip" things to make some free space in the "General" tab.

    Name:  FlexPropertyPageClip.png
Views: 573
Size:  5.6 KB

    Quote Originally Posted by smileyoufu View Post
    The property of "AlwaysAllowComboCues" in VBFlexGridDemo has not been added to "VBFLXGRD17.ocx".
    Please do you have anything convenient to add.
    That's normal. The VBFlexGridDemo is always ahead of the OCX. The added features will be available in a VBFLXGRD18.OCX at some point, but not yet.
    Last edited by Krool; Sep 5th, 2024 at 08:55 AM.

  10. #1410
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thanks!

    Testing it right now!

  11. #1411
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    271

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Is it possible to make a cell non-editable? Like myGrid.CellEnabled = False?

  12. #1412
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    This one is easy for a column:

    Code:
    Private Sub VBFlexgrid_BeforeEdit(Row As Long, Col As Long, ByVal Reason As FlexEditReasonConstants, Cancel As Boolean)
        If Col =VBFlexgrid.ColIndex("ok") Then
            Cancel = True
        End If
    End Sub

    for a cell... you can adjust this code using row too.

  13. #1413
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    271

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    This one is easy for a column:

    Code:
    Private Sub VBFlexgrid_BeforeEdit(Row As Long, Col As Long, ByVal Reason As FlexEditReasonConstants, Cancel As Boolean)
        If Col =VBFlexgrid.ColIndex("ok") Then
            Cancel = True
        End If
    End Sub

    for a cell... you can adjust this code using row too.
    Thanks, that works fine!

  14. #1414
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    271

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Another question:

    I’ve been breaking my head over some inconsistent behavior of my grid, but fail to see what I do wrong. Hopefully someone can point me in the right direction.

    The grid has 2 columns. The first column with labels is locked, the second column allows the user to input / change data, unless the cell backcolor is &H80000011 (i.e. simulating “grayed out”). When the user pressed the Enter key, the input is confirmed, and the focus is set to the next cell. The grid has 20 rows, and when row 20 has been reached, the focus jumps to another grid.

    The inconsistent behavior is that in some cases the cell goes into edit-mode and displays the value in the next cell fully selected, but in other cases only the cell is selected.

    This is the code for the control:

    Code:
    Private Sub grdDescriptions_BeforeEdit(Row As Long, Col As Long, ByVal Reason As VBFLXGRD14.FlexEditReasonConstants, Cancel As Boolean)
        If grdDescriptions.CellBackColor = &H80000011 Then
            'Don't go into edit mode as this is a locked cell
            Cancel = True
        End If
    End Sub
    
    Private Sub grdDescriptions_Click()
        grdDescriptions.Col = 1
        grdDescriptions.StartEdit
    End Sub
    
    Private Sub grdDescriptions_EditKeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = vbKeyTab Then
            KeyCode = vbKeyReturn
        End If
    End Sub
    
    Private Sub grdDescriptions_LostFocus()
        m_blnGridDescriptionsHasFocus = False
    End Sub
    
    Private Sub grdDescriptions_MouseEnter()
        If m_blnGridDescriptionsHasFocus = False Then
            grdDescriptions.SetFocus
            m_blnGridDescriptionsHasFocus = True
        End If
    End Sub
    
    Private Sub grdDescriptions_PreviewKeyDown(ByVal KeyCode As Integer, IsInputKey As Boolean)
        If KeyCode = vbKeyTab Then
            If grdDescriptions.hWndEdit <> 0 Then
                IsInputKey = True
            End If
        ElseIf KeyCode = vbKeyReturn Then
            If grdDescriptions.Row < 19 Then
                grdDescriptions.Row = grdDescriptions.Row + 1
                grdDescriptions.StartEdit
            Else
                grdData.SetFocus
                grdData.Col = 1
                grdData.Row = 0
                grdData.StartEdit
            End If
        End If
    End Sub
    What am I missing?

  15. #1415
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I think you can do (not tested):

    Code:
    Private Sub grdDescriptions_BeforeEdit(Row As Long, Col As Long, ByVal Reason As VBFLXGRD14.FlexEditReasonConstants, Cancel As Boolean)
        If grdDescriptions.CellBackColor = &H80000011 Then
            'Don't go into edit mode as this is a locked cell
            Cancel = True
        End If
    End Sub
    
    Private Sub grdDescriptions_EditKeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = vbKeyTab Then
            grdDescriptions_AfterEdit (grdDescriptions.Row, grdDescriptions.Col, true)
        End If
    End Sub
    
    Private Sub grdDescriptions_LostFocus()
        m_blnGridDescriptionsHasFocus = False
    End Sub
    
    Private Sub grdDescriptions_MouseEnter()
        If m_blnGridDescriptionsHasFocus = False Then
            grdDescriptions.SetFocus
            m_blnGridDescriptionsHasFocus = True
        End If
    End Sub
    
    Private Sub grdDescriptions_AfterEdit(ByVal Row As Long, ByVal Col As Long, ByVal Changed As Boolean)
    
    with grdDescriptions
    
       if row = .rows-1  then 'last row
                grdData.SetFocus
                grdData.Col = 1
                grdData.Row = 0
                grdData.StartEdit
       else
            .row=.row+1
            .startedit
      end if
    
    end with  
    
    End Sub

  16. #1416
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    271

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thanks for the suggestion Calcu. With some small changes I got it to work perfectly fine using the Enter key to move to the next field and selecting the data in Edit-mode. But... now the grid no longer responds correctly to mouse click to select another cell. We keep on puzzling.

  17. #1417

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Erwin69 View Post
    Another question:

    I’ve been breaking my head over some inconsistent behavior of my grid, but fail to see what I do wrong. Hopefully someone can point me in the right direction.

    The grid has 2 columns. The first column with labels is locked, the second column allows the user to input / change data, unless the cell backcolor is &H80000011 (i.e. simulating “grayed out”). When the user pressed the Enter key, the input is confirmed, and the focus is set to the next cell. The grid has 20 rows, and when row 20 has been reached, the focus jumps to another grid.

    The inconsistent behavior is that in some cases the cell goes into edit-mode and displays the value in the next cell fully selected, but in other cases only the cell is selected.

    This is the code for the control:

    Code:
    Private Sub grdDescriptions_BeforeEdit(Row As Long, Col As Long, ByVal Reason As VBFLXGRD14.FlexEditReasonConstants, Cancel As Boolean)
        If grdDescriptions.CellBackColor = &H80000011 Then
            'Don't go into edit mode as this is a locked cell
            Cancel = True
        End If
    End Sub
    
    Private Sub grdDescriptions_Click()
        grdDescriptions.Col = 1
        grdDescriptions.StartEdit
    End Sub
    
    Private Sub grdDescriptions_EditKeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = vbKeyTab Then
            KeyCode = vbKeyReturn
        End If
    End Sub
    
    Private Sub grdDescriptions_LostFocus()
        m_blnGridDescriptionsHasFocus = False
    End Sub
    
    Private Sub grdDescriptions_MouseEnter()
        If m_blnGridDescriptionsHasFocus = False Then
            grdDescriptions.SetFocus
            m_blnGridDescriptionsHasFocus = True
        End If
    End Sub
    
    Private Sub grdDescriptions_PreviewKeyDown(ByVal KeyCode As Integer, IsInputKey As Boolean)
        If KeyCode = vbKeyTab Then
            If grdDescriptions.hWndEdit <> 0 Then
                IsInputKey = True
            End If
        ElseIf KeyCode = vbKeyReturn Then
            If grdDescriptions.Row < 19 Then
                grdDescriptions.Row = grdDescriptions.Row + 1
                grdDescriptions.StartEdit
            Else
                grdData.SetFocus
                grdData.Col = 1
                grdData.Row = 0
                grdData.StartEdit
            End If
        End If
    End Sub
    What am I missing?
    Please update from VBFLXGRD14 to VBFLXGRD17.

    Also on VBFLXGRD17 you can use the DirectionAfterReturn property. Set it to "down" it will move the focus to the next cell after edit automatically.

  18. #1418
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    271

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thanks for the info Krool. I'll check it out.

  19. #1419
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,503

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Latest version (1.7)....

    I have two of your earlier versions, 1.3 and 1.6 'installed'. I just downloaded 1.7. BUT, I forgot how to 'implement/register'. According to the readme, I replaced the OLEGuids.tlb in the SYSWO directory. I also, in a project, added the REFERENCE as the readme stated. BUT, when I go to add the COMPONENT, I see only the 1.3 and 1.6 versions available to load. How do I get the 1.7 version to show up in the COMPONENT listing?

    Sorry...getting old and forget how I did things!

    Sammi
    Sam I am (as well as Confused at times).

  20. #1420
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    271

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Did you register the OCX? Something like this:

    regsvr32 "C:\Windows\System32\VBFLXGRD17.ocx"

  21. #1421
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,503

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    NEVER MIND>...Yes Erwin, I did, and then came back to this thread. Solved. (I had not downloaded the OCX.)...all is fine.
    Sam I am (as well as Confused at times).

  22. #1422

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by SamOscarBrown View Post
    Latest version (1.7)....

    I have two of your earlier versions, 1.3 and 1.6 'installed'. I just downloaded 1.7. BUT, I forgot how to 'implement/register'. According to the readme, I replaced the OLEGuids.tlb in the SYSWO directory. I also, in a project, added the REFERENCE as the readme stated. BUT, when I go to add the COMPONENT, I see only the 1.3 and 1.6 versions available to load. How do I get the 1.7 version to show up in the COMPONENT listing?

    Sorry...getting old and forget how I did things!

    Sammi
    You don't need the OLEGuids.tlb when using the OCX.

  23. #1423
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi all, i have a little question:

    Why this code is not firing _ValidateEdit event?

    Code:
    Private Sub btnmarcamanual_Click()
    Dim X As Long
    
    With Gr1
    
    For X = 1 To .rows - 1
        If .TextMatrix(X, .ColIndex("blanco")) = "X" Then
            .StartEdit X, .ColIndex("fechaenvio")
            .TextMatrix(X, .ColIndex("fechaenvio")) = Date
            .CommitEdit
        End If
    Next X
    
    End With
    End Sub

  24. #1424

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    Hi all, i have a little question:

    Why this code is not firing _ValidateEdit event?

    Code:
    Private Sub btnmarcamanual_Click()
    Dim X As Long
    
    With Gr1
    
    For X = 1 To .rows - 1
        If .TextMatrix(X, .ColIndex("blanco")) = "X" Then
            .StartEdit X, .ColIndex("fechaenvio")
            .TextMatrix(X, .ColIndex("fechaenvio")) = Date
            .CommitEdit
        End If
    Next X
    
    End With
    End Sub
    Instead of
    Code:
    .TextMatrix(X, .ColIndex("fechaenvio")) = Date
    use:
    Code:
    .EditText = Date

  25. #1425
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Incredible.

    Working fine, thanks!

  26. #1426
    New Member
    Join Date
    Sep 2024
    Posts
    1

    One Questions and Feeback -- Re: VBFlexGrid Control

    Updated 10/11/24 -- I took a bit of a break and over the weekend I looked at the OCX again.....and I found my mistake.....I thought that list/updates from Krool was a list of additional OCX features.

    I was not aware that the list of additions was for the sample application (vbflexgriddemo that utilizes the latest OCX...sorry about that)........I don't normally look at sample code so I did not make the connection.

    I have the undo/redo features working...

    Chris

    [QUOTE=Krool;5179229]This project is intended to replace the MSFlexGrid control for VB6.

    The "MSFLXGRD.OCX" can be replaced completly.

    Krool --> VBFlexGrid works well....thank you for your time and effort!

    In late August 2024, I downloaded the VBFLXGRD17.OCX via GitHub.

    Last night (9/28/24), I re-download your latest update from Sept 26 from the forum and GitHub -- when I diff the latest downloads they match the OCX dowloaded from late August (no changes in the OCX file).

    I am looking forward to trying this update:
    05-Sep-2024
    - Included the Undo/Redo/ResetUndoQueue methods and CanUndo/CanRedo functions.

    Question: Is their some other repository for the latest compiled OCX?

    Feeback: Your copy and paste function works well when performing a copy and paste within the grid itself. I only had to write a very minor bit of code (using regex) to handle the extra characters that are added to the clipboard if you paste the copied data from your grid into either Excel or Notepad....edit the data....copy and paste it back into your grid.

    Thank You for you time and effort......
    Chris
    Last edited by C_Johnson; Oct 11th, 2024 at 07:02 PM.

  27. #1427
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: One Questions and Feeback -- Re: VBFlexGrid Control

    Just for your info, Krool put a piece of code for this some pages before:
    Code:
    Private Sub Gr1_BeforeClipboardAction(ByVal Action As FlexClipboardActionConstants, Text As String, Cancel As Boolean)
    
    
    If Action = FlexClipboardActionPaste Then
        With Gr1
        .ClipSeparatorRow = vbCrLf
        .ClipSeparatorCol = vbTab
        If Right$(Text, Len(.ClipSeparatorRow)) = .ClipSeparatorRow Then ' Excel
            ' Exclude last empty line.
            Text = left$(Text, Len(Text) - Len(.ClipSeparatorRow))
        End If
        ' Parse clip string into an two-dimensional array indexed by row/col subscripts.
        Dim ArrRows As Variant
        ArrRows = .ParseClip(Text)
        '
        ' Validate and modify the array...
        '
        ' Re-construct text from the modified array.
        Text = .ConstructClip(ArrRows)
        End With
    End If
    
    End Sub

  28. #1428

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,496

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included the ColTextIndent property and CellTextIndent event.

    The ColTextIndent property (As Boolean) defines of whether or not to fire CellTextIndent for all the cells within that column.

    It's a rare feature so I did not want to extend TCELL and increase the memory usage.

    In the below example it is demonstrated to make a left indentation based on the CellTag.

    Code:
    Private Sub VBFlexGrid1_CellTextIndent(ByVal Row As Long, ByVal Col As Long, Left As Long, Right As Long)
    If VarType(VBFlexGrid1.Cell(FlexCellTag, Row, Col)) = vbLong Then
        Left = VBFlexGrid1.Cell(FlexCellTag, Row, Col)
    End If
    End Sub
    The Left/Right variables define either the left indentation or the right indentation. (or both)
    The indentation is the space, in twips, between the cell edge and the text block. (padding + indent)

    Negative values for either Left or Right will be ignored. But this can be maybe changed in future, if necessary.

    @ C_Johnson,
    VBFLXGRD18.OCX now available.
    Last edited by Krool; Yesterday at 07:36 AM.

  29. #1429
    Lively Member
    Join Date
    May 2022
    Posts
    111

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Perfect!, Thanks.

    maybe the next step is the possibility to insert a graph, a slider or something like this?

  30. #1430
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,176

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    For drawing graphs you can use the owner drawn events

Page 36 of 36 FirstFirst ... 2633343536

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