vb中滚动条image怎么写

1.vb 怎么给image控件添加滚动条我有个思路 可以解决你这个问题 测试通过
添加一个Image1设好图片 把他放在一个Picture1容器里 加上滚动条控件 下面是代码 很容易理解 不理解再问
Private Sub Form_Load()
VScroll1.Max = Image1.Height - Picture1.Height
VScroll1.Min = 0
HScroll1.Max = Image1.Width - Picture1.Width
HScroll1.Min = 0
End Sub
'TillEnd 709233593
Private Sub HScroll1_Change()
Image1.Left = -HScroll1.Value
【vb中滚动条image怎么写】End Sub
Private Sub VScroll1_Change()
Image1.Top = -VScroll1.Value
End Sub
2.vb如何使用滚动条调整image尺寸大小Dim image1height As Long, image1width As Long
Private Sub Form_Load()
image1height = Image1.Height
image1width = Image1.Width
Image1.Stretch = True
HScroll1.Value = http://www.xuexi88.com/zhishi/HScroll1.Max
End Sub
Private Sub HScroll1_Change()
Image1.Height = image1height * HScroll1.Value / HScroll1.Max
Image1.Width = image1width * HScroll1.Value / HScroll1.Max
End Sub
3.VB中如何用滚动条滚动图片Private Sub Form_Load()
VScroll1.Max = Picture1.Picture.Height
VScroll1.Min = 0
End Sub
Private Sub VScroll1_Change()
Picture1.Height = VScroll1.Value
End Sub
Private Sub VScroll1_Scroll()
Picture1.Height = VScroll1.Value
End Sub
4.VB中用滚动条浏览图片的代码窗体上添加两个同样大小的Picture控件Picture1、Picture2,再添加HScrollBar滚动条,ID为HScroll1 ,添加VScrollBar滚动条,ID为VScroll1
添加如下代码
Private Sub Form_Load()
Picture2.AutoSize = True
Picture2.BorderStyle = 0
Picture1.ScaleMode = 3
Picture2.ScaleMode = 3
HScroll1.Max = Picture2.Width - Picture1.ScaleWidth
VScroll1.Max = Picture2.Height - Picture1.ScaleHeight
End Sub
Private Sub HScroll1_Change()
Picture2.Left = -HScroll1.Value
End Sub
Private Sub HScroll1_Scroll() '实现拖动滚动条时图像即时滚动
Picture2.Left = -HScroll1.Value
End Sub
Private Sub VScroll1_Change()
Picture2.Top = -VScroll1.Value
End Sub
Private Sub VScroll1_Scroll() '实现拖动滚动条时图像即时滚动
Picture2.Top = -VScroll1.Value
End Sub
即可实现滚动浏览图片,其实Picture2的属性Picture设置为要浏览的图片
5.VB中用滚动条浏览图片的代码是什么窗体上添加两个同样大小的Picture控件Picture1、Picture2,再添加HScrollBar滚动条,ID为HScroll1 ,添加VScrollBar滚动条,ID为VScroll1
添加如下代码
Private Sub Form_Load()
Picture2.AutoSize = True
Picture2.BorderStyle = 0
Picture1.ScaleMode = 3
Picture2.ScaleMode = 3
HScroll1.Max = Picture2.Width - Picture1.ScaleWidth
VScroll1.Max = Picture2.Height - Picture1.ScaleHeight
End Sub
Private Sub HScroll1_Change()
Picture2.Left = -HScroll1.Value
End Sub
Private Sub HScroll1_Scroll() '实现拖动滚动条时图像即时滚动
Picture2.Left = -HScroll1.Value
End Sub
Private Sub VScroll1_Change()
Picture2.Top = -VScroll1.Value
End Sub
Private Sub VScroll1_Scroll() '实现拖动滚动条时图像即时滚动
Picture2.Top = -VScroll1.Value
End Sub
即可实现滚动浏览图片,其实Picture2的属性Picture设置为要浏览的图片
6.VB中用滚动条浏览图片的代码窗体上添加两个同样大小的Picture控件Picture1、Picture2,再添加HScrollBar滚动条,ID为HScroll1 ,添加VScrollBar滚动条,ID为VScroll1添加如下代码Private Sub Form_Load()Picture2.AutoSize = TruePicture2.BorderStyle = 0Picture1.ScaleMode = 3Picture2.ScaleMode = 3HScroll1.Max = Picture2.Width - Picture1.ScaleWidthVScroll1.Max = Picture2.Height - Picture1.ScaleHeightEnd SubPrivate Sub HScroll1_Change()Picture2.Left = -HScroll1.ValueEnd SubPrivate Sub HScroll1_Scroll() '实现拖动滚动条时图像即时滚动Picture2.Left = -HScroll1.ValueEnd SubPrivate Sub VScroll1_Change()Picture2.Top = -VScroll1.ValueEnd SubPrivate Sub VScroll1_Scroll() '实现拖动滚动条时图像即时滚动Picture2.Top = -VScroll1.ValueEnd Sub即可实现滚动浏览图片,其实Picture2的属性Picture设置为要浏览的图片 。