我给《怎样控制ScrollBar?》提供了的程序水平移动抖的很烈害,还

grievefish 2000-03-10 08:32:00
我给《怎样控制ScrollBar?》提供了的程序水平移动抖的很烈害,还
请高人指点!
...全文
193 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
grievefish 2000-03-13
  • 打赏
  • 举报
回复
为什么没人答复?
喂!SoftDIY大虾您到哪去了?
grievefish 2000-03-11
  • 打赏
  • 举报
回复
Dim oldx As Single
Dim oldy As Single
Dim newx As Single
Dim newy As Single
Dim move As Boolean

Private Sub Form_Load()
pictureim.Picture = LoadPicture("c:\windows\安装程序.bmp")
End Sub
Private Sub Form_Resize()
On Error Resume Next
Picturerp.Width = Form1.ScaleWidth - VScroll1.Width
Picturerp.Height = Form1.ScaleHeight - HScroll1.Height
HScroll1.Width = Picturerp.Width
HScroll1.Top = Picturerp.Height
VScroll1.Height = Picturerp.Height
VScroll1.Left = Form1.ScaleWidth - VScroll1.Width
End Sub

Private Sub Pictureim_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
move = True
oldx = X
oldy = Y
End Sub


Private Sub Pictureim_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next

Dim movex As Single
Dim movey As Single
newx = X
newy = Y
If move Then '是否可移动
movex = newx - oldx '水平移动量
movey = newy - oldy '垂直移动量

If pictureim.Top >= 0 Then '是否下移到极限
pictureim.Top = 0
If newy >= oldy Then '是否继续下移
oldy = newy
movey = 0
End If
End If
If pictureim.Top <= Picturerp.Height - pictureim.Height Then
pictureim.Top = Picturerp.Height - pictureim.Height
If newy <= oldy Then
movey = 0
End If
End If
pictureim.Top = pictureim.Top + movey
VScroll1.Value = pictureim.Top / (Picturerp.Height - _
pictureim.Height) * 100
If pictureim.Left >= 0 Then
pictureim.Left = 0
If newx >= oldy Then
oldx = newx
monex = 0
End If
End If
If pictureim.Left <= Picturerp.Width - pictureim.Width Then
pictureim.Left = Picturerp.Width - pictureim.Width
If newx <= oldy Then
oldy = newy
movey = 0
End If
End If
HScroll1.Value = pictureim.Left / (Picturerp.Width - _
pictureim.Width) * 100
pictureim.Left = pictureim.Left + movex
End If

End Sub

Private Sub pictureim_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
move = False
End Sub
水平移动有些抖动,还请别人指点!

不好意思! grievefish 2000-3-9 20:11:55 0
不好意思!
MOVE忘了改了!
MOVE都改成IMOVE.
&_&

SoftDIY 2000-03-10
  • 打赏
  • 举报
回复
《怎样控制ScrollBar?》在什么地方啊^O^

33,008

社区成员

发帖
与我相关
我的任务
社区描述
数据结构与算法相关内容讨论专区
社区管理员
  • 数据结构与算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧