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

Main form - Sub form problem

P: n/a
I am building a Pocket PC application in C#. I have 5 forms (1 main and 4
sub forms). The main form must always

load first. The sub forms are loaded from the main form. The application is
run using Application.Run(new

MainForm()); The user may choose to load one of the sub forms automaticaly
at startup, but when I do the folowing

in the MainForm_Load(......) function the Main form always shows up infront
of the subform:
private void MainForm_Load(.....)
{
...
...
SubForm sub = new SubForm();
sub.Show();
sub.BringToFront();
this.Hide();
this.SendToBack();
...
...
}

Is there a way that I can load the Main form and then automaticaly load one
of the sub forms with the sub form

being shown infront of the main form? Sub forms cannot exist if there is no
main form.
Aug 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Vladimir Oľura wrote:
Is there a way that I can load the Main form and then automaticaly load one
of the sub forms with the sub form

being shown infront of the main form? Sub forms cannot exist if there is no
main form.
Perhaps overload the constructor to take an integer which indicates
which subform to load. The show the main form and then the sub form.

You also might try setting the subform's parent or owner to the main
form. That might make it stay in front.

Aug 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.