Page 41 of 42 FirstFirst ... 313839404142 LastLast
Results 1,601 to 1,640 of 1650

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #1601

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Mustaphi View Post
    Hello again Krool
    I need to allow only numeric values and the decimal point in column 2 but this code doesn't seem to work
    Code:
    Private Sub VBFlexGrid1_KeyPress(KeyChar As Integer)
    With VBFlexGrid1
          If .Col = 2 Then
              Select Case KeyAscii
            Case vbKey0 To vbKey9
            Case Asc(".")
       Case Else
                KeyAscii = 0
        End Select
    
      End If
      End With
    End Sub
    thank you
    With so little context it is difficult to help.

    I assume you are referring to user editing a cell ? If yes, then KeyPress is the wrong event. Probably EditKeyPress event is what you are looking for.
    Also to note is that KeyAscii got renamed to KeyChar in my events.

  2. #1602
    Fanatic Member
    Join Date
    Jan 2016
    Posts
    834

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    thank you Krool it worked

  3. #1603
    Fanatic Member
    Join Date
    Oct 2013
    Posts
    793

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hello krool
    I Wonder how to feed this table.
    Name:  28.png
Views: 970
Size:  1.7 KB
    Last edited by samer22; Oct 28th, 2025 at 12:17 PM.

  4. #1604

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by samer22 View Post
    Hello krool
    I Wonder how to feed this table.
    Name:  28.png
Views: 970
Size:  1.7 KB
    In the demo it uses the ColComboItems, ColComboHeader and ColComboBoundColumn.

    You have a bug certainly which I can't reproduce. I have a deja-vu of this issue.
    I am dependant on YOU to locate this bug. It must be the WM_DRAWITEM handler.

  5. #1605
    Junior Member
    Join Date
    Dec 2020
    Posts
    29

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Ref: Making MergeRow cells editable

    Searched the thread and didn't find anything. I would like to set up a three column row, where the first column is a label and the other two columns are MergeRow=True with the same string to merge them. The cell appears to be selected, but no keyed text is shown. I also check grid.EditText for data checking but ValidateEdit never get fired. Any assistance is greatly appreciated. Thx!

  6. #1606

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by TheLeePiper View Post
    Ref: Making MergeRow cells editable

    Searched the thread and didn't find anything. I would like to set up a three column row, where the first column is a label and the other two columns are MergeRow=True with the same string to merge them. The cell appears to be selected, but no keyed text is shown. I also check grid.EditText for data checking but ValidateEdit never get fired. Any assistance is greatly appreciated. Thx!
    In the demo project it is possible to edit merged cells. So, I don't understand what the problem is.
    Please make a replicable demo showing your issue. Thanks

  7. #1607
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,261

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Oy mate.
    I knew of this thing for a long time, but now i looked closer at it.

    Question: Can i use this in Excel VBA? in your source i saw you have conditionals for VBA7
    Just import it as a file? How to place it in the Form_Designer?

    Believe it or not: Have never used a "ctl" in my life, so i have no idea

    Note: Can't use the OCX, since i'm not allowed to ship any binary files in the company, nevermind placing it in system32
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  8. #1608

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Zvoni View Post
    Oy mate.
    I knew of this thing for a long time, but now i looked closer at it.

    Question: Can i use this in Excel VBA? in your source i saw you have conditionals for VBA7
    Just import it as a file? How to place it in the Form_Designer?

    Believe it or not: Have never used a "ctl" in my life, so i have no idea

    Note: Can't use the OCX, since i'm not allowed to ship any binary files in the company, nevermind placing it in system32
    You can't.
    When you have 32-bit Excel you could use the OCX.
    For 64-bit Excel we would need to re-compile the OCX in twinBASIC. I have done only the package for experimental purpose but not yet done a 64-bit OCX.

  9. #1609

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by samer22 View Post
    Hello krool
    I Wonder how to feed this table.
    Name:  28.png
Views: 970
Size:  1.7 KB
    Again, please test WM_DRAWITEM handler. As it is a window proc an error will not go into debug..
    You may place several debug.print in there and see which one does not get printed to narrow down the problem. Thanks

  10. #1610
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,261

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    You can't.
    When you have 32-bit Excel you could use the OCX.
    For 64-bit Excel we would need to re-compile the OCX in twinBASIC. I have done only the package for experimental purpose but not yet done a 64-bit OCX.
    Ah, OK.
    Well, will have to continue using ListView
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  11. #1611

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included hWndToolTip/hWndScrollTip read-only run-time property.

    This allows for example to overwrite the max tip width of an info tip or scroll tip.

    Code:
    SendMessage VBFlexGrid1.hWndToolTip, TTM_SETMAXTIPWIDTH, 0, ByVal 400&
    
    SendMessage VBFlexGrid1.hWndScrollTip, TTM_SETMAXTIPWIDTH, 0, ByVal 300&
    The label tip shares the same hWndToolTip but it will not be restricted by TTM_SETMAXTIPWIDTH as it resizes upon TTN_SHOW anyway to the needed size.

    The OCX got updated and typelib jumped to 1.4
    Code:
    Object={075212A8-C1CF-444E-939D-F6046CCDBC08}#1.4#0; VBFLXGRD18.OCX
    Last edited by Krool; Oct 31st, 2025 at 10:06 AM.

  12. #1612
    Junior Member
    Join Date
    Dec 2020
    Posts
    29

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    In the demo project it is possible to edit merged cells. So, I don't understand what the problem is.
    Please make a replicable demo showing your issue. Thanks
    Got it resolved. Error in my code for handling some of the data checking. Apologies for the inconvenience, and thanks!

  13. #1613
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    After selecting all cells using ".SelectRange 0, 0, fgTmp.Rows - 1, fgTmp.Cols - 1", the originally fixed rows and columns that were not editable become editable. Is this considered a bug?

  14. #1614

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by fengzhongxia View Post
    After selecting all cells using ".SelectRange 0, 0, fgTmp.Rows - 1, fgTmp.Cols - 1", the originally fixed rows and columns that were not editable become editable. Is this considered a bug?
    Who said fixed cells are not editable?
    There are not movable to. But due to code you can move to a fixed cell.
    That's intended and cannot be denied.

    Also denying editing a fixed cell would be an artificial limitation.

    Solution: handle the BeforeEdit event and Cancel = True when row/col are fixed cell.

  15. #1615
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I want the selected cell background color to be a blend of two colors, specifically the cell's actual foreground color and the selection color (default is blue), so that differences in cell colors can still be distinguished within the selected area. How can I achieve this? Thank you very much.

  16. #1616

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by fengzhongxia View Post
    I want the selected cell background color to be a blend of two colors, specifically the cell's actual foreground color and the selection color (default is blue), so that differences in cell colors can still be distinguished within the selected area. How can I achieve this? Thank you very much.
    I understand what you want but not why. Black text for example is hardly readable at blue selection background.
    Therefore there is this SelForeColor and SelBackColor property.

    There is (currently?) no way to ignore the SelForeColor property.

    I could imagine to allow following trick: "The SelForeColor property is ignored, if it has the same value as ForeColor property."

    But why you need it? Can't imagine a use case..
    Last edited by Krool; Jan 28th, 2026 at 01:23 PM.

  17. #1617
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    I understand what you want but not why. Black text for example is hardly readable at blue selection background.
    Therefore there is this SelForeColor and SelBackColor property.

    There is (currently?) no way to ignore the SelForeColor property.

    I could imagine to allow following trick: "The SelForeColor property is ignored, if it has the same value as ForeColor property."

    But why you need it? Can't imagine a use case..
    Suppose I mark cell A2 in the table by setting its text color to red. During a meeting, I select a range to indicate to my colleagues that the data within this range is usable, but the marked A2 should not be used. If A2 is included in the range, I cannot easily tell whether the selected area contains any marked cells.

  18. #1618

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by fengzhongxia View Post
    Suppose I mark cell A2 in the table by setting its text color to red. During a meeting, I select a range to indicate to my colleagues that the data within this range is usable, but the marked A2 should not be used. If A2 is included in the range, I cannot easily tell whether the selected area contains any marked cells.
    Ok, I see. Will then soon introduce new "UseForeColorSel" property which would default to True.

  19. #1619
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    THANK YOU very much!

  20. #1620

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included the UseForeColorSel property which defaults to True.

    The OCX got updated and typelib jumped to 1.5
    Code:
    Object={075212A8-C1CF-444E-939D-F6046CCDBC08}#1.5#0; VBFLXGRD18.OCX

  21. #1621
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Update released.

    Included the UseForeColorSel property which defaults to True.

    The OCX got updated and typelib jumped to 1.5
    Code:
    Object={075212A8-C1CF-444E-939D-F6046CCDBC08}#1.5#0; VBFLXGRD18.OCX
    Name:  1.jpg
Views: 690
Size:  46.6 KBName:  2.jpg
Views: 688
Size:  60.6 KB
    The foreground color is blended very well. Could you also blend the background? Thank you so much!

  22. #1622

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    How should that work / look like ?

  23. #1623
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    The cells with values 99.97, 99.96, and 99.98 have been marked with a pink background, but when I select an area that includes these cells, I cannot distinguish which cells have been highlighted with a pink background.

  24. #1624
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Add the UseBackColorSel property. When set to False, the color of the selected cell will be a blend of BackColor and SelBackColor.

  25. #1625

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by fengzhongxia View Post
    Add the UseBackColorSel property. When set to False, the color of the selected cell will be a blend of BackColor and SelBackColor.
    Such a new property would not work. Because you want the BackColorSel, just not on those cells where a cell custom back color is defined, right?

  26. #1626

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    fengzhongxia,

    you can achieve what you need by a "workaround".

    Continue to use .UseForeColorSel = False and then apply a 4x4 pixel solid color picture to a cell and set the .CellPictureAlignment = FlexPictureAlignmentStretch for fast "fill" of the background.

    The picture is then effectively over the selected back color. See below example of the purple picture with a cyan fore color. Beneath a cell with red fore color and no custom background.

    Name:  VBFlexGridNoBackColorSel.png
Views: 682
Size:  3.2 KB

    Only problem is when you still need a real picture in that cell. But this could also be circumvented when using ColImageList..

  27. #1627
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    This method you've mentioned meets my requirements perfectly. Thank you so much, expert!

  28. #1628

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by fengzhongxia View Post
    This method you've mentioned meets my requirements perfectly. Thank you so much, expert!
    Another (more elegant) solution is to use .CellFloodColor and .CellFloodPercent.
    Of course .CellFloodPercent must be set to 100.

  29. #1629

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Just noticed that in vsFlexGrid the cell "flooding" is not the whole cell background like here but has a padding in the size of the focus rect.
    So the original cell back color or selected back color is still visible.
    I kinda like this more and updated it now. That's also how it works in Excel with the solid bars.

    Name:  FlexGridFloodPadding.png
Views: 630
Size:  2.7 KB
    Last edited by Krool; Feb 3rd, 2026 at 01:39 PM.

  30. #1630
    Junior Member
    Join Date
    Apr 2022
    Posts
    21

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thinks!Very Good!

  31. #1631
    Addicted Member
    Join Date
    Oct 2014
    Posts
    128

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hello Krool!

    Thank you very much for providing the great VBCCR control.

    1. The VBFlexGrid.ColPosition property is currently 'write-only'. Could it be changed to 'read/write'?
    2. Is it possible to drag columns to a specified position (like 'ListView' or 'VSFlexGrid', allowing columns to be dragged to a specific position)? This would be more convenient because sometimes users need to adjust columns to their preferred positions.
    3. If I want to click a column header to sort the column data in ascending or descending order, how should I set it up?

    I hope to get your help, thank you very much!

  32. #1632

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by smileyoufu View Post
    1. The VBFlexGrid.ColPosition property is currently 'write-only'. Could it be changed to 'read/write'?
    2. Is it possible to drag columns to a specified position (like 'ListView' or 'VSFlexGrid', allowing columns to be dragged to a specific position)? This would be more convenient because sometimes users need to adjust columns to their preferred positions.
    3. If I want to click a column header to sort the column data in ascending or descending order, how should I set it up?
    1. The .ColPosition is indeed write-only. Will check it, thanks. But what's the reason you need to read it ? It's the same value as you input as index ? The vsFlexGrid and MSFlexGrid also are write-only.

    2. Use the .DragCol function. Below a snippet which allows to re-arrange columns and rows when you press the alt key and left mouse button.
    Code:
    Private Sub VBFlexGrid1_BeforeMouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single, Cancel As Boolean)
    With VBFlexGrid1
    If Button = vbLeftButton And (Shift And vbAltMask) = vbAltMask Then
        .HitTest X, Y
        If .HitResult = FlexHitResultCell Then
            If .HitCol < .FixedCols And .HitRow >= .FixedRows Then
                VBFlexGrid1.RowPosition(.HitRow) = VBFlexGrid1.DragRow(.HitRow)
                Cancel = True
            ElseIf .HitCol >= .FixedCols And .HitRow < .FixedRows Then
                VBFlexGrid1.ColPosition(.HitCol) = VBFlexGrid1.DragCol(.HitCol)
                Cancel = True
            End If
        End If
    End If
    End With
    End Sub
    3. Use also the BeforeMouseDown event and set the .ColSortArrow and .ColSort properties and then you may use .Sort = FlexSortUseColSort for individual column sortings. You will figure it out for sure.
    You can also set .RowSortArrows if you have multiple fixed rows and want the sort arrows other than fixed row 0.
    Last edited by Krool; Feb 12th, 2026 at 01:36 AM.

  33. #1633
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,666

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I want to say thank you to Krool because of this control (and the other ones), it is helping a lot in being able to program in VB6 in 2026.
    All the new functions of this grid that allow editing are of great help.

  34. #1634
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    VbFlexGrid supposrts CellOwnerDraw, like VBFlexGrid1.CellOwnerDraw(row, col) = True?

  35. #1635

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by fabel358 View Post
    VbFlexGrid supposrts CellOwnerDraw, like VBFlexGrid1.CellOwnerDraw(row, col) = True?
    will not implement it, at least not in the master branch. What do you want to draw?

  36. #1636
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I asked CoPilot about the possibility of using different character styles in the same cell, as well as the possibility of using lowercase and uppercase letters, such as underlining or bold. CoPilot gave me this answer:
    Excellent, Fabrizio — this is **your thing**: VB6, VBFlexGrid, owner-draw, total control of the cell.

    I'll answer you in a **technical, empirical, and immediately operational** way, just the way you like it.

    ---

    # ? How does `CellOwnerDraw(row, column) = True` work in VBFlexGrid

    When you set:

    ```vb
    VBFlexGrid1.CellOwnerDraw(row, column) = True
    ```

    You're telling the control:

    > "For this cell, **don't draw anything**.
    > Call me in the `OwnerDrawCell` event and I'll do it."

    This is a complete override of cell rendering.

    ---

    # ? What you need to do after activating it

    You need to handle the event:

    ```vb
    Private Sub VBFlexGrid1_OwnerDrawCell(ByVal Row As Long, _
    ByVal Col As Long, _
    ByVal hDC As Long, _
    ByVal Left As Long, _
    ByVal Top As Long, _
    ByVal Right As Long, _
    ByVal Bottom As Long, _
    ByVal DrawState As OwnerDrawStateConstants)
    ```

    Here you have:

    - the hDC to draw on
    - the cell's rectangle
    - the state (selected, focused, etc.)

    And you can use any GDI API: `FillRect`, `TextOut`, `DrawText`, `BitBlt`, etc.

    ---

    # ? Minimal and working example

    Gray background and red text designs:

    ```vb
    Private Sub VBFlexGrid1_OwnerDrawCell(Row As Long, Col As Long, _
    hDC As Long, Left As Long, Top As Long, _
    Right As Long, Bottom As Long, _
    DrawState As OwnerDrawStateConstants)

    Dim rc As RECT
    rc.Left = Left
    rc.Top = Top
    rc.Right = Right
    rc.Bottom = Bottom

    ' Background
    FillRect hDC, rc, CreateSolidBrush(RGB(230, 230, 230))

    ' Text
    SetTextColor hDC, RGB(200, 0, 0)
    DrawText hDC, VBFlexGrid1.TextMatrix(Row, Col), -1, rc, DT_LEFT Or DT_VCENTER Or DT_SINGLELINE
    End Sub
    ```

    ---

    # ? Important Note

    `CellOwnerDraw` must be set before the cell is drawn, so:

    - in `Form_Load`
    - or immediately after filling the grid
    - or dynamically before a `Refresh`

    ---

    # ? Want to do something more advanced?

    I can help you:

    - draw **icons** or **images** in the cell
    - create **progress bars**, **badges**, **status indicators**
    - manage **hover**, **selection**, **focus**
    - implement **symmetric cell rendering** with centralized logic (in line with your style)

    Tell me what you want to achieve and I'll prepare a clean, symmetric, and benchmark-safe code block.
    That's all... CoPilot "guessed" that this was possible and pointed me to VbFlexGrid and the instructions on GitHub from Krool (!!!)

    CoPilot evidently has a lot of imagination

  37. #1637

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    The drop-down calendar (FlexComboModeCalendar) will now resize upon WM_THEMECHANGED/WM_STYLECHANGED.
    This allows to change theme/styles for the calendar on the EditSetupWindow event. (window created but not yet visible)

    WM_THEMECHANGED for the obvious reason when someone dares to try to make a dark mode and needs the visual styles changed per code.
    Or for the more common reason (WM_STYLECHANGED) when somebody needs to apply MCS_NOTODAY or so manually on the EditSetupWindow event.

  38. #1638

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Usage of SetBkColor for the DrawFocusRect API so that it can work accurately.

    This is especially visible when using dark mode colors. Just compare the focus rect below. Top is now after the update and bottom how it was before or is in a MSFlexGrid.

    Name:  FlexDrawFocusRect_SetBkColor.png
Views: 119
Size:  565 Bytes

  39. #1639
    Member
    Join Date
    Apr 2021
    Posts
    54

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

    Dear Krol, an observation: By having the tabindex at 0 or another control (it can be commad Button, or another control) the DrawFocusRect property in the vbflexgrid disappears when the form is loaded..., however, componentone's FlexGrid does meet those characteristics.
    Last edited by lizano diaz; May 25th, 2026 at 10:20 AM.

  40. #1640

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by lizano diaz View Post
    Dear Krol, an observation: By having the tabindex at 0 or another control (it can be commad Button, or another control) the DrawFocusRect property in the vbflexgrid disappears when the form is loaded..., however, componentone's FlexGrid does meet those characteristics.
    If you are using visual styles you might need to send WM_UPDATEUISTATE to the Form to show the focus cues.
    Code:
    SendMessage Form.hWnd, WM_UPDATEUISTATE, MakeDWord(UIS_CLEAR, UISF_HIDEFOCUS Or UISF_HIDEACCEL), ByVal 0&

Page 41 of 42 FirstFirst ... 313839404142 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