Board index » cppbuilder » How can I get BCB6 to start with Form2 not Form3

How can I get BCB6 to start with Form2 not Form3


2004-08-28 09:06:01 PM
cppbuilder64
C++ Builder 6
I have three forms. Forms 2 and 3 are children, I can see one or the other.
I want to start with Form2 visible, but it always starts with Form3.
I tried "Form2->Show()" at the end of Form3's FormCreate but it does not
work.
The same code works later (when I doubleclick in Form3 or click a menu
item).
--
Lawrence Tuppen
Email: XXXX@XXXXX.COM Web: homepage.ntlworld.com/tuppenl
 
 

Re:How can I get BCB6 to start with Form2 not Form3

This is due to the creation order. You can do one of two things.
1) Remove form 3 from your projects Auto-Created forms and over to
available forms. This will make it so you will need to create form 3
dynamically when you want it. - This is found in the Project / Options
menu, under the Forms tab.
2) Change the form creation order within you main .cpp file.
Change:
Application->CreateForm(__classid(TForm1), &Form1);
Application->CreateForm(__classid(TForm2), &Form2);
Application->CreateForm(__classid(TForm3), &Form3);
To:
Application->CreateForm(__classid(TForm1), &Form1);
Application->CreateForm(__classid(TForm3), &Form3);
Application->CreateForm(__classid(TForm2), &Form2);
On Sat, 28 Aug 2004 14:06:01 +0100, "Lawrence Tuppen"
< XXXX@XXXXX.COM >wrote:
Quote
C++ Builder 6

I have three forms. Forms 2 and 3 are children, I can see one or the other.
I want to start with Form2 visible, but it always starts with Form3.
I tried "Form2->Show()" at the end of Form3's FormCreate but it does not
work.
The same code works later (when I doubleclick in Form3 or click a menu
item).
 

Re:How can I get BCB6 to start with Form2 not Form3

Thank you. I have done (2) and it works well. I will remember (1) for the
future. I have only just started with Builder (its a price thing) and I am
trying to rewrite my old C++ programs into Builder. My next challenge is to
control window size dynamically depending on content, which was not all that
easy under C++ and is not even mentioned in my 'learn Builder' book. Thank
goodness I dont work for a living any more. Once again, thanks for your
help. You have made an old man happy.
<Mike {*word*99}o>wrote in message
Quote
This is due to the creation order. You can do one of two things.
 

{smallsort}