how to show form

  • Thread starter Thread starter Haris Bogdanovic
  • Start date Start date
H

Haris Bogdanovic

how do I refer to other form from main form so I can call its Show method ?

Thanks
Haris
 
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
 
Haris Bogdanovic said:
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
 
Back
Top