<th*****@msala.net> wrote in message
news:43**********************@news.newsdemon.com.. .
If I use Application.Run(New Form1) in the below code.
New Form1 creates a new *object* of /Type/ Form1.
This object is passed to the Application.Run method.
Then code like TAM.Form1.rtbAllAcq.Text = aryStatistics(0)
There is no "Global" reference to Form1 any more (that ended with
VB6). You must use a variable to hold a reference to the Form1
*object*, so you can use it elsewhere in the project or, better
still, pass the Form object (or Control) between methods.
' Reinventing Global Form1 - inadvisable, but will work.
Global frmOne as Form1
Sub Main()
frmOne = New Form1
Application.Run( frmOne )
End Sub
' Passing things around ...
Public Class Form1
. . .
Public Property AllAcqText() as String
Get
Return rtbAllAcq.Text
End Get
Set( Value as String )
rtbAllAcq.Text = Value
End Set
End Property
. . .
End Class
[Module1.vb]
Module OtherCode
Public Sub LoadFromArray( _
ByVal oaForm as Form1 _
, ByVal oaData as SomeSortOfArray _
)
oaForm.AllAcqText = oaData( 0 )
End Sub
End Module
Then
LoadFromArray( frmOne, aryStatistics )
HTH,
Phill W.