Private Sub Form_Load()
PicColor.Visible = False
RefreshButton.Enabled = False
'scrollMax = 51
'HScroll1.Max = scrollMax ' Set maximum value.
'HScroll1.LargeChange = 3 ' Cross in 17 clicks.
'HScroll1.SmallChange = 1 ' Cross in 51 clicks.
With Picture2
.ScaleMode = vbPixels
.AutoRedraw = True
Set mPic = picPV.Image 'LoadPicture("C:\mypic.bmp") '(Load your picture in this line)
mWidth = ScaleX(mPic.Width, vbHimetric, vbPixels)
mHeight = ScaleX(mPic.Height, vbHimetric, vbPixels)
.PaintPicture mPic, 0, 0
End With
If mHeight > Picture2.ScaleHeight Then
With VScroll1
.Min = 0
.Max = mHeight - Picture2.ScaleHeight
.SmallChange = ((mHeight - Picture2.ScaleHeight) / 100) + 1
.LargeChange = ((mHeight - Picture2.ScaleHeight) / 10) + 1
End With
Else
VScroll1.Enabled = False
End If
If mWidth > Picture2.ScaleWidth Then
With HScroll1
.Min = 0
.Max = mWidth - Picture2.ScaleWidth
.SmallChange = ((mWidth - Picture2.ScaleWidth) / 100) + 1
.LargeChange = ((mWidth - Picture2.ScaleWidth) / 10) + 1
End With
Else
HScroll1.Enabled = False
End If
End Sub