Results 1 to 5 of 5

Thread: [RESOLVED] Flexgrid Scrollbar Problems, Please Help!

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    Resolved [RESOLVED] Flexgrid Scrollbar Problems, Please Help!

    Hi, I'm new to VB and I'm having a few problems.

    I've got a flexgrid containing both static text and dynamic objects that sit on top of the cells, rather than inside them.
    I've got a scrollbar on the flexgrid which will only move the static text in the flexgrid, not the dynamic objects. I also have a sort button that sorts the grid based on a column of dynamic objects that are reading a priority value from elsewhere on the system I'm working on. The sort button works, but again only for the static text.

    So what I need is a way to keep the dynamic objects tied with the cells. They will appear to where they should do at first, so I know all the static text is mapped correctly to the dynamic objects.

    On a simpler note, in runtime the scrollbar seems to jump straight to reading the values at the bottom of the grid, how do I set it so the default position is at the top of the grid?

    I hope someone can help, it'll be very much appreciated.

    Lumineon

  2. #2
    Hyperactive Member deathfxu's Avatar
    Join Date
    Mar 2009
    Location
    USA
    Posts
    279

    Re: Flexgrid Scrollbar Problems, Please Help!

    Firstly, the TopRow property of the control determines the highest visible row (LeftCol is the horizontal scroll property I believe).

    Secondly, there is no smooth "in cell" scrolling with the FlexGrid control. I'm not sure what you could do as a reasonable workaround. Sorry. =/

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    Re: Flexgrid Scrollbar Problems, Please Help!

    Thanks for the tip, got the scrollbar position working fine now.

    Anyone got any ideas for the rest of my problem?

    lumineon

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    Re: Flexgrid Scrollbar Problems, Please Help!

    i found this in another forum, is this what I'm looking for?

    vb Code:
    1. Private Sub MSFlexGrid1_Scroll()
    2. ÿ ÿ ' This event is triggered when either of the scoll bars are used
    3. ÿ ÿ ' We need to reposition the checkboxes and check visibility of them.
    4. ÿ ÿ Dim iRow As Integer
    5. ÿ ÿ Dim iCol As Integer
    6. ÿ ÿ Dim iChkIdx As Integer
    7. ÿ ÿ
    8. ÿ ÿ With MSFlexGrid1
    9. ÿ ÿ ÿ ÿ For iRow = .FixedRows To .Rows - 1
    10. ÿ ÿ ÿ ÿ ÿ ÿ For iCol = .FixedCols To .Cols - 1
    11. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ iChkIdx = (iRow - .FixedRows) * (.Cols - .FixedCols) + iCol
    12. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ If .ColIsVisible(iCol) And .RowIsVisible(iRow) Then
    13. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ
    14. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ 'ÿ Position the checkbox on theÿ flexgrid's cell
    15. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Top = .Top + .RowPos(iRow) + 50
    16. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Left = .Left + .ColPos(iCol) + 60
    17. 'ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Height = .CellHeight
    18. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ
    19. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ 'ÿ By default, the new checkbox is not visible as the original one that was copied
    20. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Visible = True
    21. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).ZOrder 0ÿ 'ÿ will send the control at the front
    22. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Else
    23. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Visible = False
    24. ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ End If
    25. ÿ ÿ ÿ ÿ ÿ ÿ Next iCol
    26. ÿ ÿ ÿ ÿ Next iRow
    27. ÿ ÿ End With
    28. End Sub

    Hope someone can clear this up for me

    lumineon

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2009
    Posts
    4

    Re: Flexgrid Scrollbar Problems, Please Help!

    Figured it out by myself, thanks anyway

    lumineon

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