Furqan
Nov 22nd, 1999, 05:13 PM
Can anyone help me in doing so....
Thanks in advance.
Aaron Young
Nov 22nd, 1999, 10:16 PM
Place 2 Pictureboxes on a Form and a Horizontal and Vertical Scrollbar, (Don't Worry about positioning anything)
Then, treating Picture1 as your Virtual Form, make it as big as you want your VF to be and add some controls to it so that they are contained within Picture1. (Right Click the Control, select Cut, Right Click Picture1, Select Paste).
Then use this code in the Form..
Private Sub Form_Load()
Picture1.Move 0, 0
Picture1.BorderStyle = vbBSNone
Picture1.ZOrder 1
Picture2.BorderStyle = vbBSNone
Picture2.Visible = False
End Sub
Private Sub Form_Resize()
DoEvents
HScroll1.Visible = (ScaleWidth < Picture1.Width)
VScroll1.Visible = (ScaleHeight < Picture1.Height)
If HScroll1.Visible Then
HScroll1.Move 0, ScaleHeight - HScroll1.Height, ScaleWidth - IIf(VScroll1.Visible, VScroll1.Width, 0), HScroll1.Height
HScroll1.Max = Picture1.Width - (ScaleWidth - IIf(VScroll1.Visible, VScroll1.Width, 0))
HScroll1.LargeChange = HScroll1.Max / 10
HScroll1.SmallChange = 100
Else
HScroll1 = 0
End If
If VScroll1.Visible Then
VScroll1.Move ScaleWidth - VScroll1.Width, 0, VScroll1.Width, ScaleHeight - IIf(HScroll1.Visible, HScroll1.Height, 0)
VScroll1.Max = Picture1.Height - (ScaleHeight - IIf(VScroll1.Visible, HScroll1.Height, 0))
VScroll1.LargeChange = VScroll1.Max / 10
VScroll1.SmallChange = 100
Else
VScroll1 = 0
End If
If HScroll1.Visible And VScroll1.Visible Then
Picture2.Move VScroll1.Left, HScroll1.Top, VScroll1.Width, HScroll1.Height
Picture2.Visible = True
Else
Picture2.Visible = False
End If
End Sub
Private Sub HScroll1_Change()
HScroll1_Scroll
End Sub
Private Sub HScroll1_Scroll()
Picture1.Move -HScroll1, -VScroll1
End Sub
Private Sub VScroll1_Change()
HScroll1_Scroll
End Sub
Private Sub VScroll1_Scroll()
HScroll1_Scroll
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net