怎样去做一个VB的图片浏览器啊。。。急急急!!!!
发布网友
发布时间:2024-02-26 13:19
我来回答
共2个回答
热心网友
时间:2024-03-24 02:28
Private Sub Form_Load()
'初始化两个图片框的位置
PicFather.Move 0, 0, ScaleWidth - VScroll1.Width, ScaleHeight - HScroll1.Height
PicSon.Move 0, 0 '将子图片框移到容器(父图片框)左上角
'定位水平滚动条
HScroll1.Top = PicFather.Height
HScroll1.Left = 0
HScroll1.Width = PicFather.Width
'定位垂直滚动条
VScroll1.Top = 0
VScroll1.Left = PicFather.Width
VScroll1.Height = PicFather.Height
'设置滚动条的Max属性
HScroll1.Max = PicSon.ScaleWidth - PicFather.ScaleWidth
VScroll1.Max = PicSon.ScaleHeight - PicFather.ScaleHeight
'判断图形是否已完整显示。若是,则不显示滚动条。
VScroll1.Visible = (PicFather.ScaleHeight < PicSon.ScaleHeight) '判断垂直方向
HScroll1.Visible = (PicFather.ScaleWidth < PicSon.ScaleWidth) '判断水平方向
End Sub
Private Sub Form_Resize()
Form_Load
End Sub
Private Sub HScroll1_Change()
PicSon.Left = -HScroll1.Value
End Sub
Private Sub PicSon_Click()
End Sub
Private Sub VScroll1_Change()
PicSon.Top = -VScroll1.Value
End Sub
热心网友
时间:2024-03-24 02:28
我有啊,给我一邮箱吧追问919279074@qq.com