Form的中加一个Public变量,就可以通过Form名.变量名访问
解决方案 »
- vbs 求次方(帮忙找错?)
- VB6项目问题一个。请进各位!来者有分!
- ACCESS 数据库压缩的问题
- vb调用sql带参数的存储过程,提示实时错误,将截断字符串及二进制数据?why?
- 做了个网站:代码酷,收集源代码下载,请各位赏光
- WM_RBUTTONDOWN消息的消息参数wParam及lParam的意义如何?
- VB6用ADO与oracle连接问题!!!特急!!在线等待
- image控件能调用imagelist控件中的图形吗?怎么调用?
- 我痛哭我流泪......我跳楼!
- TextBox的文本被选择时的消息
- 如何在vb中得到type lib里的信息
- MSDN里的ADO例子,我运行不成功有高手指点迷津吗?加24分
然后在form2中可以用form1.i来引用
Form=Form1.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\SYSTEM\STDOLE2.TLB#OLE Automation
Form=Form2.frm
Startup="Form1"
Command32=""
Name="工程1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
ThreadPerObject=0
MaxNumberOfThreads=1Form1.frmVERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 495
Left = 1500
TabIndex = 0
Top = 1080
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public i As IntegerPrivate Sub Command1_Click()
i = 12345
Form2.Show
End SubForm2.frm
VERSION 5.00
Begin VB.Form Form2
AutoRedraw = -1 'True
Caption = "Form2"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form2"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Command2"
Height = 495
Left = 1590
TabIndex = 0
Top = 1125
Width = 1215
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Print Form1.i
End Sub
然后在form2中可以用form1.i来引用