
MSHFlexGrid ScrollBar Question
Hi all
I'm using a MSHFlexGrid to show records from a recordset. All the fileds I
select from the recordset are from the same table.
I've succeeded to insert checkbox into the grid but now I have a problem
with the vertical Scrol bar. When I try to scroll, the checkboxes loose
theire connection to the row, and 'jump' out of the grid.
The code I wrote is:
code:--------------------------------------------------------------
Private Sub Combo1_GotFocus()
With hfgPrClb
Call objQuery.GetPerClub(iPersonSysNo)
Set .DataSource = rsQuery
hfgPrClb.Col = 3
hfgPrClb.AddItem ""
For i = 1 To iCount - 1
hfgPrClb.Row = i
chkMark(i).Value = 0
chkMark(i).Top = hfgPrClb.CellTop + hfgPrClb.Top
chkMark(i).Height = hfgPrClb.CellHeight
chkMark(i).Left = hfgPrClb.CellLeft + hfgPrClb.Left - 150
chkMark(i).Width = 255
chkMark(i).ZOrder 0
Call addChkMark
Next i
end sub
The next sub add checkboxes
Public Sub addChkMark()
Load chkMark(chkMark.UBound + 1)
chkMark(chkMark.UBound).Visible = True
chkMark(chkMark.UBound).Move chkMark(1).Left, chkMark(chkMark.UBound -
1).Top + hfgPrClb.CellHeight, chkMark(1).Width, chkMark(1).Height
End Sub
and the Next sub should deal with the scrol
Private Sub hfgPrClb_Scroll()
n = 1
chkMark(n).Top = hfgPrClb.CellHeight
chkMark(n).ZOrder
For m = n + 1 To n + 19
chkMark(m).Top = chkMark(m - 1).Top + hfgPrClb.CellHeight
chkMark(m).ZOrder
Next
End Sub
Thanks,
Ohad