1个回答
展开全部
'先在窗体上画一个图片框,一个垂直流动条和一个水平流动条
Dim HValue As Integer
Dim VValue As Integer
Dim WidValue As Integer
Dim HeiValue As Integer
Private Sub Form_Load()
WindowState = 2
Caption = "Rolling Form"
Picture1.AutoSize = True
pictrue1.Picture = ("你图片的路径")
End Sub
Private Sub Form_Resize()
WidValue = ScaleWidth - VScroll1.Width
HeiValue = ScaleHeight - HScroll1.Height
Picture1.Top = 0
Picture1.Left = 0
HScroll1.Top = HeiValue
HScroll1.Left = 0
HScroll1.Width = WidValue
VScroll1.Top = 0
VScroll1.Left = WidValue
VScroll1.Height = HeiValue + HScroll1.Height
HScroll1.Max = Picture1.Width - WidValue
VScroll1.Max = Picture1.Height - HeiValue
HScroll1.Min = 0
VScroll1.Min = 0
VScroll1.LargeChange = 100
VScroll1.SmallChange = 5
HScroll1.LargeChange = 100
HScroll1.SmallChange = 5
End Sub
Private Sub HScroll1_Change()
HValue = HScroll1.Value
Picture1.Move -HValue, -VValue
End Sub
Private Sub VScroll1_Change()
VValue = VScroll1.Value
Picture1.Move -HValue, -VValue
End Sub
Dim HValue As Integer
Dim VValue As Integer
Dim WidValue As Integer
Dim HeiValue As Integer
Private Sub Form_Load()
WindowState = 2
Caption = "Rolling Form"
Picture1.AutoSize = True
pictrue1.Picture = ("你图片的路径")
End Sub
Private Sub Form_Resize()
WidValue = ScaleWidth - VScroll1.Width
HeiValue = ScaleHeight - HScroll1.Height
Picture1.Top = 0
Picture1.Left = 0
HScroll1.Top = HeiValue
HScroll1.Left = 0
HScroll1.Width = WidValue
VScroll1.Top = 0
VScroll1.Left = WidValue
VScroll1.Height = HeiValue + HScroll1.Height
HScroll1.Max = Picture1.Width - WidValue
VScroll1.Max = Picture1.Height - HeiValue
HScroll1.Min = 0
VScroll1.Min = 0
VScroll1.LargeChange = 100
VScroll1.SmallChange = 5
HScroll1.LargeChange = 100
HScroll1.SmallChange = 5
End Sub
Private Sub HScroll1_Change()
HValue = HScroll1.Value
Picture1.Move -HValue, -VValue
End Sub
Private Sub VScroll1_Change()
VValue = VScroll1.Value
Picture1.Move -HValue, -VValue
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询