Originally Posted by
Petr Schreiber
maybe you could create viewport control inside tab to do what you need.
I think your suggestion will work. It will also solve another problem I was pondering over yesterday - multiple tabs, a hierarchy of tabs, if you will. That was a nightmare for an amateur like me.
On another note, I did find a way to get the contents of the tab page to move with the scrollbar: Control Set Loc.
Here's how it might work:
'------------------------------------------------------------------
CallBack Function cb_SB_proc() As Long
'------------------------------------------------------------------
Local lID As Long = 2005
Local x, y As Integer
Select Case CBMSG
Case %WM_VSCROLL
Select Case LOWRD(CBWPARAM)
Case %SB_TOP
ScrollBar_SetPos(CBHNDL, lID, ScrollBar_GetRangeLow(CBHNDL, lID))
Case %SB_BOTTOM
ScrollBar_SetPos(CBHNDL, lID, ScrollBar_GetRangeHi(CBHNDL, lID))
Case %SB_LINEUP
ScrollBar_SetPos(CBHNDL, lID, ScrollBar_GetPos(CBHNDL, lID) - 1)
Case %SB_LINEDOWN
ScrollBar_SetPos(CBHNDL, lID, ScrollBar_GetPos(CBHNDL, lID) + 1)
Case %SB_PAGEUP
ScrollBar_SetPos(CBHNDL, lID, ScrollBar_GetPos(CBHNDL, lID) - ScrollBar_GetPageSize(CBHNDL, lID))
Case %SB_PAGEDOWN
ScrollBar_SetPos(CBHNDL, lID, ScrollBar_GetPos(CBHNDL, lID) + ScrollBar_GetPageSize(CBHNDL, lID))
Case %SB_THUMBTRACK
ScrollBar_SetPos(CBHNDL, lID, ScrollBar_GetTrackPos(CBHNDL, lID))
End Select
y = 10
For x = 5 To 10
Control Set Loc CBHNDL, x, 10, y - ScrollBar_GetPos(CBHNDL, lID)
y += 20
Next x
End Select
End Function
The important part is at the bottom of the function when CONTROL SET LOC is used. I also put the CONTROL SET LOC command in a FOR/NEXT loop so that you could go through an entire page of controls with a little amount of code. The control IDs would all have to be either in a row or in a pattern that could be picked up with the STEP keyword.
Mark
Bookmarks