global forms?

L

lizii

i have two forms - for purposes of explaining i will call them form A
and form B one of which is a searching tool for the user.

What i would like to do is somewhere in form A is call form B and leave
it hidden - then when i say openBForm i just want to make that form
Visible - then when they are done and select the option they want -
hide form B again until they want it again.

Now i have tried to go in the header file and write:

public: formB BForm = new formB();


but the compiler complains when i try to attempt to do this - i would
rather not be passing around references for a form as that just seems a
bit clunky.


Any clues as to what i am doing wrong?

Thanks again!

Liz.
 
B

Ben Voigt

lizii said:
i have two forms - for purposes of explaining i will call them form A
and form B one of which is a searching tool for the user.

What i would like to do is somewhere in form A is call form B and leave
it hidden - then when i say openBForm i just want to make that form
Visible - then when they are done and select the option they want -
hide form B again until they want it again.

Now i have tried to go in the header file and write:

public: formB BForm = new formB();


but the compiler complains when i try to attempt to do this - i would
rather not be passing around references for a form as that just seems a
bit clunky.


Any clues as to what i am doing wrong?

Yup, using C# syntax in a C++ program.

try:

ref class FormA : public Form
{
public:
FormB^ BForm;

FormA()
: BForm(gcnew FormB())
{
}
};
 

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

Top