Here's an Example of using a Picturebox and 2 Scrollbars to create a virtual space as big as the Printer Paper Size..
On a Form with a Picturebox, a Vertical Scrollbar and a Horizontal Scrollbar..
------------------Code:Private Sub Form_Load() Dim sCenter As String sCenter = "Some Centered Text" Picture1.Move VScroll1.Width, 0, Printer.ScaleWidth, Printer.ScaleHeight Picture1.BorderStyle = vbBSNone Picture1.AutoRedraw = True Picture1.Print "Top, Left"; Picture1.CurrentX = Picture1.Width - 900 Picture1.Print "Top, Right" Picture1.CurrentY = Picture1.Height - 200 Picture1.Print "Bottom, Left"; Picture1.CurrentX = Picture1.Width - 1100 Picture1.Print "Bottom, Right" Picture1.CurrentX = (Picture1.Width - Picture1.TextWidth(sCenter)) / 2 Picture1.CurrentY = (Picture1.Height - Picture1.TextHeight(sCenter)) / 2 Picture1.Print sCenter VScroll1.Max = Picture1.Height - ScaleHeight + HScroll1.Height HScroll1.Max = Picture1.Width - ScaleWidth + VScroll1.Width Picture1.ZOrder 1 HScroll1_Change VScroll1_Change End Sub Private Sub Form_Resize() VScroll1.Move ScaleWidth - VScroll1.Width, 0, VScroll1.Width, ScaleHeight - HScroll1.Height HScroll1.Move 0, ScaleHeight - HScroll1.Height, ScaleWidth - VScroll1.Width End Sub Private Sub HScroll1_Change() Picture1.Left = -HScroll1 End Sub Private Sub HScroll1_Scroll() HScroll1_Change End Sub Private Sub VScroll1_Change() Picture1.Top = -VScroll1 End Sub Private Sub VScroll1_Scroll() VScroll1_Change End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]




Reply With Quote