[image of digits]

Making More Windows

If you follow this sequence, you should be successful:

  1. File/New Form
  2. Save AllFile / Use Unit (select Unit1 on Unit21.cpp)
  3. File / Use Unit (select Unit2 on Unit1.cpp)
  4. Save All
  5. The program should then run...
  6. Add an event handler to make Form2->Visible = true;. This could be the event handler of a Button or any other component.
  7. If variables need to be shared between the two Units, repeat them in the second Unit with the prefix extern.
Begin Your New Project from Scratch in the Usual Way
File / New / VCL Forms Application - C++ Builder
Before you press the Green Arrow...
File / Save Project As... and accept the defaults, twice.
You may now press the Green Arrow...
How to Add a New Window to Your Project
File / New / Form creates a new Form2 and a new Unit2 to go with it
Go to Unit2.cpp
File / Use Unit...
Select Unit1
Go to Unit1.cpp
File / Use Unit...
Select Unit2
File / Save All
You may now press the Green Arrow...
Add Code to Manipulate the New Window
Add a Button to Form1
In its event handler, set Form2->Visible = true;
Press the Green Arrow
to test it...
If you want the
variables in Unit1 on Form1
to be available on Form2, declare them again in Unit2, prefacing them with
the word "extern"
That's All there is to It...