|
-
May 29th, 2009, 03:44 AM
#1
Thread Starter
New Member
[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
-
May 29th, 2009, 04:04 AM
#2
Hyperactive Member
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. =/
-
May 29th, 2009, 04:21 AM
#3
Thread Starter
New Member
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
-
May 29th, 2009, 08:56 AM
#4
Thread Starter
New Member
Re: Flexgrid Scrollbar Problems, Please Help!
i found this in another forum, is this what I'm looking for?
vb Code:
Private Sub MSFlexGrid1_Scroll()
ÿ ÿ ' This event is triggered when either of the scoll bars are used
ÿ ÿ ' We need to reposition the checkboxes and check visibility of them.
ÿ ÿ Dim iRow As Integer
ÿ ÿ Dim iCol As Integer
ÿ ÿ Dim iChkIdx As Integer
ÿ ÿ
ÿ ÿ With MSFlexGrid1
ÿ ÿ ÿ ÿ For iRow = .FixedRows To .Rows - 1
ÿ ÿ ÿ ÿ ÿ ÿ For iCol = .FixedCols To .Cols - 1
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ iChkIdx = (iRow - .FixedRows) * (.Cols - .FixedCols) + iCol
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ If .ColIsVisible(iCol) And .RowIsVisible(iRow) Then
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ 'ÿ Position the checkbox on theÿ flexgrid's cell
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Top = .Top + .RowPos(iRow) + 50
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Left = .Left + .ColPos(iCol) + 60
'ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Height = .CellHeight
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ 'ÿ By default, the new checkbox is not visible as the original one that was copied
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Visible = True
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).ZOrder 0ÿ 'ÿ will send the control at the front
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Else
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Check1(iChkIdx).Visible = False
ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ End If
ÿ ÿ ÿ ÿ ÿ ÿ Next iCol
ÿ ÿ ÿ ÿ Next iRow
ÿ ÿ End With
End Sub
Hope someone can clear this up for me
lumineon
-
May 29th, 2009, 10:00 AM
#5
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|