这是人家写的一种方法
form1.frm
VERSION 5.00
Begin VB.Form Form1
Caption = "This Form is larger than the screen can show"
ClientHeight = 5940
ClientLeft = 1935
ClientTop = 2085
ClientWidth = 6735
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 5940
ScaleWidth = 6735
Begin VB.HScrollBar HScroll
Height = 300
LargeChange = 900
Left = -60
SmallChange = 30
TabIndex = 2
Top = 5370
Width = 6435
End
Begin VB.VScrollBar VScroll
Height = 5625
LargeChange = 900
Left = 5550
SmallChange = 30
TabIndex = 1
Top = 0
Width = 300
End
Begin VB.PictureBox PicBox
BackColor = &H00FFFFFF&
Height = 15900
Left = -2820
ScaleHeight = 15840
ScaleWidth = 11580
TabIndex = 0
Top = -4170
Width = 11640
Begin VB.TextBox Text1
Height = 2535
Left = 3030
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 10
Top = 3870
Width = 3705
End
Begin VB.ListBox List1
Height = 3480
Left = 7830
TabIndex = 7
Top = 600
Width = 3105
End
Begin VB.CommandButton Command1
Caption = "End This Program"
Height = 465
Left = 1980
TabIndex = 6
Top = 540
Width = 2445
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Gee, I just love little graphics on forms, don't you?"
BeginProperty Font
Name = "Arial"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 1035
Index = 3
Left = 4890
TabIndex = 9
Top = 12870
Width = 3135
End
Begin VB.Shape Shape2
BackColor = &H000000FF&
BorderColor = &H0000FFFF&
BorderStyle = 4 'Dash-Dot
BorderWidth = 3
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 1815
Index = 1
Left = 8040
Shape = 3 'Circle
Top = 12810
Width = 2565
End
Begin VB.Shape Shape2
FillColor = &H00FF0000&
FillStyle = 2 'Horizontal Line
Height = 1815
Index = 0
Left = 1950
Shape = 2 'Oval
Top = 13320
Width = 2565
End
Begin VB.Shape Shape1
Height = 2115
Left = 2640
Shape = 4 'Rounded Rectangle
Top = 7800
Width = 4995
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1365
Index = 2
Left = 3030
TabIndex = 8
Top = 8340
Width = 3135
End
Begin VB.Line Line3
X1 = 6480
X2 = 6630
Y1 = 9060
Y2 = 8850
End
Begin VB.Line Line2
X1 = 6450
X2 = 6630
Y1 = 8670
Y2 = 8850
End
Begin VB.Line Line1
X1 = 6240
X2 = 6660
Y1 = 8850
Y2 = 8850
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = "These controls have been placed on this picture box at design time, but can also be added at run-time too."
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 2205
Index = 1
Left = 630
TabIndex = 5
Top = 2310
Width = 1815
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "This is a ""Virtual Form"""
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 315
Index = 0
Left = 360
TabIndex = 4
Top = 1350
Width = 2865
End
Begin VB.Label lblFiller
Height = 300
Left = 6870
TabIndex = 3
Top = 8670
Width = 300
End
End
Begin VB.Menu mnuFileMenu
Caption = "&File"
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
form1.frm
VERSION 5.00
Begin VB.Form Form1
Caption = "This Form is larger than the screen can show"
ClientHeight = 5940
ClientLeft = 1935
ClientTop = 2085
ClientWidth = 6735
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 5940
ScaleWidth = 6735
Begin VB.HScrollBar HScroll
Height = 300
LargeChange = 900
Left = -60
SmallChange = 30
TabIndex = 2
Top = 5370
Width = 6435
End
Begin VB.VScrollBar VScroll
Height = 5625
LargeChange = 900
Left = 5550
SmallChange = 30
TabIndex = 1
Top = 0
Width = 300
End
Begin VB.PictureBox PicBox
BackColor = &H00FFFFFF&
Height = 15900
Left = -2820
ScaleHeight = 15840
ScaleWidth = 11580
TabIndex = 0
Top = -4170
Width = 11640
Begin VB.TextBox Text1
Height = 2535
Left = 3030
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 10
Top = 3870
Width = 3705
End
Begin VB.ListBox List1
Height = 3480
Left = 7830
TabIndex = 7
Top = 600
Width = 3105
End
Begin VB.CommandButton Command1
Caption = "End This Program"
Height = 465
Left = 1980
TabIndex = 6
Top = 540
Width = 2445
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Gee, I just love little graphics on forms, don't you?"
BeginProperty Font
Name = "Arial"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 1035
Index = 3
Left = 4890
TabIndex = 9
Top = 12870
Width = 3135
End
Begin VB.Shape Shape2
BackColor = &H000000FF&
BorderColor = &H0000FFFF&
BorderStyle = 4 'Dash-Dot
BorderWidth = 3
FillColor = &H000000FF&
FillStyle = 0 'Solid
Height = 1815
Index = 1
Left = 8040
Shape = 3 'Circle
Top = 12810
Width = 2565
End
Begin VB.Shape Shape2
FillColor = &H00FF0000&
FillStyle = 2 'Horizontal Line
Height = 1815
Index = 0
Left = 1950
Shape = 2 'Oval
Top = 13320
Width = 2565
End
Begin VB.Shape Shape1
Height = 2115
Left = 2640
Shape = 4 'Rounded Rectangle
Top = 7800
Width = 4995
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1365
Index = 2
Left = 3030
TabIndex = 8
Top = 8340
Width = 3135
End
Begin VB.Line Line3
X1 = 6480
X2 = 6630
Y1 = 9060
Y2 = 8850
End
Begin VB.Line Line2
X1 = 6450
X2 = 6630
Y1 = 8670
Y2 = 8850
End
Begin VB.Line Line1
X1 = 6240
X2 = 6660
Y1 = 8850
Y2 = 8850
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Caption = "These controls have been placed on this picture box at design time, but can also be added at run-time too."
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 2205
Index = 1
Left = 630
TabIndex = 5
Top = 2310
Width = 1815
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "This is a ""Virtual Form"""
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 315
Index = 0
Left = 360
TabIndex = 4
Top = 1350
Width = 2865
End
Begin VB.Label lblFiller
Height = 300
Left = 6870
TabIndex = 3
Top = 8670
Width = 300
End
End
Begin VB.Menu mnuFileMenu
Caption = "&File"
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
解决方案 »
- 关于XML导入TREEVIEW,TREEVIEW导出XML的问题,已实现但有问题请教
- MSChart最大值、最小值及平均值等显示为红色线条
- 怎样返回文件夹列表框中选定的文件夹名。
- 用VB6的ActiveX DLL创建的DLL,在其他程序中使用这个DLL中的函数时还要先创建对象,真麻烦。如何才能象调用WINDOWS API一样直接调用这个D
- 新手上路(取经)
- 數組需要釋放嗎?數組為什么在窗體級中不能用PUBLIC?
- 实时错误91,“对象变量或with变量未设置”是怎么回事?
- 散分!不来vb版了。强烈跟换斑竹
- 诺大个VB版居然没有个像样的VB颜色转网页颜色的代码,我贴一个吧!
- 使用WebBrowser 控件一些叶面总是弹出脚本错误,可用ie来看就没事
- 用vb做webbrowser,如何更改其在浏览http时候的引用?(refer link)
- 请教:如何用winsock传送图片,怎么还原
' Resize the scrollbars
HScroll.Width = Me.ScaleWidth - lblFiller.Width
VScroll.Height = Me.ScaleHeight - lblFiller.Height
' Reposition the scrollbars
HScroll.Left = 0: HScroll.Top = Me.ScaleHeight - HScroll.Height
VScroll.Top = 0: VScroll.Left = Me.ScaleWidth - VScroll.Width
' Redimension the scrollbar parameters
HScroll.Max = PicBox.Width - Me.ScaleWidth
VScroll.Max = PicBox.Height - Me.ScaleHeight
' Reposition the PictureBox
PicBox.Top = (-1 * VScroll)
PicBox.Left = (-1 * HScroll)
' Reposition the Picturebox label by scrollbars
lblFiller.Top = VScroll.Height + VScroll - 30
lblFiller.Left = HScroll.Width + HScroll - 30
UpdateDisplay
End SubSub UpdateDisplay()
' Place text on the PictureBox
PicBox.AutoRedraw = True
Dim PictureBoxText As String
PictureBoxText = "Virtual Form - 8? x 11 size"
With PicBox
.Font = "Arial"
.FontSize = 14
.FontBold = True
.FontItalic = True
.CurrentX = (PicBox.Width - PicBox.TextWidth(PictureBoxText)) / 2
.CurrentY = 0
End With
PicBox.Print PictureBoxText
' Graphics can be drawn on the virtual form at run time
PicBox.Line (100, 100)-(500, 500), , B
End SubPrivate Sub Command1_Click()
End
End SubPrivate Sub Form_Resize()
AlignScrollBars
End SubPrivate Sub HScroll_Change()
AlignScrollBars
End SubPrivate Sub VScroll_Change()
AlignScrollBars
End Sub