当前位置: 代码迷 >> PB >> 窗体、自定义对象滚动条怎么用代码控制滚动
  详细解决方案

窗体、自定义对象滚动条怎么用代码控制滚动

热度:582   发布时间:2016-04-29 10:41:40.0
窗体、自定义对象滚动条如何用代码控制滚动
用的PB8,窗体、自定义对象的vscroll不能通过鼠标滚轮进行滚动。
请问如果要实现鼠标滚轮滚动时,窗体的vscroll也进行相应滚动,应该如何写
other事件:
Choose Case Message.Number
Case 522
If IntHigh(Message.WordParm) = 120 Then
//鼠标向上滚动代码
  Else
//鼠标向下滚动代码
End If
End Choose

------解决方案--------------------
C/C++ code
constant long SB_LINEUP = 0constant long SB_LINELEFT = 0constant long SB_LINEDOWN = 1constant long SB_LINERIGHT = 1constant long SB_PAGEUP = 2constant long SB_PAGELEFT = 2constant long SB_PAGEDOWN = 3constant long SB_PAGERIGHT = 3constant long SB_TOP = 6constant long SB_LEFT = 6constant long SB_BOTTOM = 7constant long SB_RIGHT = 7constant long WM_HSCROLL= 276constant long WM_VSCROLL = 277Choose Case Message.Number    Case 522        If IntHigh(Message.WordParm) = 120 Then            //鼠标向上滚动代码              SEND(handle(this), WM_VSCROLL, SB_LINEUP, 0)          Else            //鼠标向下滚动代码             SEND(handle(this), WM_VSCROLL, SB_LINEDOWN, 0)          End If End Choose
  相关解决方案