Passing Variables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was wondering how I could pass variables between forms?

Thanks in advance
 
Hello,

I think you are after ByRef. You can set-up a parameter on the New()
function or another method in the child form, like the example below.

Private m_MyVariable As Object = Nothing

''' pass variable into child form
Public Sub New(ByRef MyVariable As Object)

''' child form has access to same object
m_MyVariable = MyVariable

End Sub

The child form will refer to the same object.

Hope this helps,
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:[email protected]
-
 
* "=?Utf-8?B?TWF0dA==?= said:
I was wondering how I could pass variables between forms?

/Variables/ or /references/ to objects? The latter can be done by
adding public properties to a form and making a reference to the
instance of the form available to the other form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top