473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Main form - Sub form problem

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
1 6144
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: chris vettese | last post by:
On my subform I have a field in the footer that totals the value of a field. On the main form I have referenced this field. I'm using this field in a calculation on my main form. The problem...
3
by: Hans Karman | last post by:
I have a form (giving details of a person) and a subform (giving details of the person's assets). A search in the form for a particular name using the Find dialog box finds the wanted person. The...
5
by: geoff | last post by:
I've got an add form with a link that opens a pop up window. The main add form has a drop down menu with items populated from a db. In the popup window, you can add additional items to the db, so...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
2
by: James R Esposito | last post by:
I am trying to transition from Access97 to Visual Basic.net. My biggest challenge to date is the creation of a Main/Sub Form. In Access97 You create a main form and you can then insert a sub...
2
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to...
4
by: Bremanand | last post by:
Hi..Am doing Retailer software using VB 6.0 with ms-access.. Actually i have many form(sales entry form,purchase entry form ,stock form, etc..) in my project which all are in MDI except Log in...
1
by: prabuinet | last post by:
hi, I added a form as a control on another form. After adding i want the embedded form to have focus. I tried all combinations but its not working.. Do any one know how to do this. ...
5
by: LamSoft | last post by:
I've got some problem on some form submit problem. In a master page, there is a form tag with the "runat=server" attribute, and a ID called "myForm". In the contentPlaceHolder under that...
1
by: sayeediqbal | last post by:
Dear All i have two form: 1) login.php 2) main.php I send info for oracle database login userid and password through login.php and call main.php through submit method. in main.php, I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.