VB fpspreadpreview如何实现预览页面的鼠标拖动查看
来源:百度知道 编辑:UC知道 时间:2024/06/23 03:07:04
用图片孔家容器实现拖动就不需要上来问了,目前实现数据显示用了fpspread控件,预览的时候本打算用VB自带的预览控件,但是不支持鼠标滚轮所以放弃了。早知道应该用VC开发的,
那么现在这个答案与你的问题不符合的地方在哪里呢?你说下吧
PS:鼠标滚轮很简单啊 只要几个API就可以了
================
我没有听说过,不过查了一下 这个应该是一个控件吧!
给你一个惯用的思路(不知道能不能试用于这个):
假设有一个label和一个picture,(label在pic里面)那么拖动的代码就是这样:
Option Explicit
Dim MoveScreen As Boolean
Dim MousX As Integer
Dim MousY As Integer
Dim CurrX As Integer
Dim CurrY As Integer
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
MoveScreen = True
If Label1.Width + Label1.Left > Picture1.Width Then MousX = X
If Label1.Height + Label1.Top > Picture1.Height Then MousY = Y
End If
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If MoveScreen Then
If Label1.Width + Label1.Left > Picture1.Width Then
CurrX = Label1.Left - MousX + X
If CurrX > 0 Then CurrX = 0
If CurrX + Label1.Width