I want to put a scrollbar on an app, the scrollbar is NOT attached to any control, it's just there to make a user think he is scrolling through pages of labels/textboxes when in reality I will relabel and reuse those text/label controls...
So I've searched and come up with code but not grasping what i"m doing wr ong, I'm ASSUMING that since I'm using this as a control and not the dialog scroll taht I should treat it like any other control and put it under WM_COMMAND.......no?
Note I'm also only using a vertical scrollbar.
I can also tell something is wrong as it appears to be two scrollbars jammed together, not a nice clean control (It's a visual thing)
So I've searched and come up with code but not grasping what i"m doing wr ong, I'm ASSUMING that since I'm using this as a control and not the dialog scroll taht I should treat it like any other control and put it under WM_COMMAND.......no?
Note I'm also only using a vertical scrollbar.
I can also tell something is wrong as it appears to be two scrollbars jammed together, not a nice clean control (It's a visual thing)
Code:
In my DIalog Proc Static hScrollCtl As Long Static SB As SCROLLINFO Select Case CbMsg Case %WM_INITDIALOG SB.cbSize=SizeOf(SB) SB.fMask=%SIF_ALL SB.nMin=1 SB.nMax=100 SB.nPage=10 SB.nPos=1 SB.nTrackPos=0 SetScrollInfo ByVal hScrollCtl,ByVal %SB_VERT, SB, %TRUE Case %WM_COMMAND Select Case LoWrd(CbWParam) Case %IDVSCROLL GetScrollInfo hScrollCtl, %SB_VERT, SB Local oldPos As Long oldPos = SB.nPos Select Case LoWrd(CbWParam) Case %SB_LINEDOWN SB.nPos = SB.nPos + 1 Case %SB_PAGEDOWN SB.nPos = SB.nPos + SB.nPage Case %SB_LINEUP SB.nPos = SB.nPos - 1 Case %SB_PAGEUP SB.nPos = SB.nPos - SB.nPage Case %SB_THUMBTRACK SB.nPos = HiWrd(CbWParam) Case Else Exit Function End Select SB.fMask = %SIF_POS SetScrollInfo hScrollCtl, %SB_VERT, SB, 1 ScrollWindow hScrollCtl, 0, oldPos - SB.nPos, ByVal %NULL, ByVal %NULL
Comment