实现窗口间的参数传递

发表于:2007-07-01来源:作者:点击数: 标签:

最近在用powerbuilder开发程序觉得其中的openwithparam()函数很好用

在vb中实现起来也很简单
建立一个模块加入如下代码:
Sub openfromwithparam(ByVal str As String)
        Dim Form As Form2
        Set Form = New Form2
        Form.str = str
         Form.Label1.Caption = Form.str
        
          Form.Show
End Sub
form1代码如下:
Private Sub Command1_Click()
      Call openfromwithparam("liyong")
End Sub

Private Sub Form_Load()

End Sub

form2代码:

Public str As String

Private Sub Form_Load()

End Sub

 


原文转自:http://www.ltesting.net