By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,680 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,680 IT Pros & Developers. It's quick & easy.

how to show form

P: n/a
how do I refer to other form from main form so I can call its Show method ?

Thanks
Haris
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
dim MyForm as OtherForm
MyForm = New OtherForm

MyForm.Show


"Haris Bogdanovic" <ha**************@zg.hinet.hr> wrote in message
news:OV*************@tk2msftngp13.phx.gbl...
how do I refer to other form from main form so I can call its Show method ?

Thanks
Haris

Nov 20 '05 #2

P: n/a
"Haris Bogdanovic" <ha**************@zg.hinet.hr> scripsit:
how do I refer to other form from main form so I can call its Show method ?


\\\
Call (New Form2()).Show()
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

P: n/a
> Call (New Form2()).Show()

But the form I want to show is already created in designer. I don't want a
new form.
The question was really how do I refer to some existing object from one
module (form) to another (in C its done by including header file of the
object I want to refer to)?

Thanks
Nov 20 '05 #4

P: n/a
"Haris Bogdanovic" <ha**************@zg.hinet.hr> schrieb
Call (New Form2()).Show()
But the form I want to show is already created in designer.


The designer is only a tool to create source code and resources for a Form
*class*. When the application runs, you must first create a Form *object*
and show it. An object is called an "istance of a class", and it is created
by the New keyword.
I don't
want a new form.
The question was really how do I refer to some existing object from
one module (form) to another (in C its done by including header file
of the object I want to refer to)?


As mentioned above, you must have created the Form anywhere. If you want to
access the Form object in a module, you must pass the reference to the Form
object to the module.

Have a look here:

<F1>
Visual Studio.NET
Visual Basic and Visual C#
Reference
Visual Basic language
Visual Basic Language Tour
Object oriented programming in Visual Basic
--
Armin

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.