17-10-12, 12:45 AM
كاتب الموضوع : AhmedEssawy
*** الكود منقول من المنتدى القديم :كود :
Option Explicit
Private Sub Form_Resize()
If Me.ScaleHeight < picMain.Height Then
VScroll1.Move 0, 0, HScroll1.Height, Me.ScaleHeight - HScroll1.Height
picMain.Left = VScroll1.Width
VScroll1.Min = 0
VScroll1.Max = -(picMain.Height - Me.ScaleHeight)
VScroll1.SmallChange = 50
VScroll1.LargeChange = 500
Else
VScroll1.Width = 0
picMain.Left = 0
VScroll1.Move Me.ScaleWidth + VScroll1.Width
End If
If Me.ScaleWidth < picMain.Width Then
HScroll1.Move VScroll1.Width, Me.ScaleHeight - HScroll1.Height, Me.ScaleWidth - VScroll1.Width
HScroll1.Min = 0
HScroll1.Max = -(picMain.Width - Me.ScaleWidth) - VScroll1.Width
HScroll1.SmallChange = 50
HScroll1.LargeChange = 500
Else
HScroll1.Move 0, Me.ScaleHeight + HScroll1.Height
End If
End Sub
Private Sub HScroll1_Change()
picMain.Left = HScroll1.Value + VScroll1.Width
End Sub
Private Sub HScroll1_Scroll()
picMain.Left = HScroll1.Value + VScroll1.Width
End Sub
Private Sub VScroll1_Change()
picMain.Top = VScroll1.Value
End Sub
Private Sub VScroll1_Scroll()
picMain.Top = VScroll1.Value
End Sub