两个窗体,form1和form2,在form1中有一个已赋值数组,现要在form2中使用这个数组,请问除了在module中将数组定义成Public这种方法外,还有什么办法没。
解决方案 »
- 如何让ListBox 控件实现图标的显示。如图搜狗输入法管理器中的列表一样
- BHO 问题(在线等加急)
- 哪有vb下Windows Media Player9.0控件的事件,方法,属性
- 自己做的DTPicker控件弹出的日期选择框会被遮盖住,怎么办?
- 问个问题
- 急急急--请教:fpSpreadPreview打印预览怎么看不到?????????
- 新手问题,各位帮忙,在线等
- 请问在网站里能否找到用VB作的应用程序的实例(我指一个完整的工程)并付说明,因为本人实践经验少。。。
- 个性问题求解!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 给我个思路~怎么样给listbox加上背景?~~
- vb6 注册表binary类型写入问题
- 为什么我用FindFirstFile方法得到的文件大小总是为0?
Option Explicit
Dim aa$
Private Sub Form_Load()
Me.Tag = "aaa"
Form2.Show
End SubForm2的代码
Option Explicit
Private Sub Command1_Click()
MsgBox Form1.Tag
End Sub
' Form1 中的代码
Option ExplicitPrivate PtX(5) As Long, PtY(5) As LongPrivate Sub Command1_Click() Form2.Show
Call Form2.DrawLine(PtX, PtY)
End SubPrivate Sub Form_Load() PtX(0) = 500: PtX(1) = 500: PtX(2) = 940: PtX(3) = 1500: PtX(4) = 2500: PtX(5) = 3500
PtY(0) = 1100: PtY(1) = 700: PtY(2) = 700: PtY(3) = 2700: PtY(4) = 1300: PtY(5) = 700End Sub' Form2 中的代码
Option ExplicitPrivate lThisPnt As LongPublic Sub DrawLine(arrDataX() As Long, arrDataY() As Long) Dim j As Long
lThisPnt = UBound(arrDataX)
For j = 0 To lThisPnt - 1
Form2.Circle (arrDataX(j), arrDataY(j)), 15, 0
Form2.Line (arrDataX(j), arrDataY(j))-(arrDataX(j + 1), arrDataY(j + 1))
Next j
Form2.Circle (arrDataX(j), arrDataY(j)), 15, 0End Sub
忘了Public的对象不能在窗体模块中定义
同意,在窗体中声明public变量!