Solved

C# - Displaying Subforms

Posted on 2007-04-10
4
1,810 Views
Last Modified: 2009-03-24
Hi guys 'n gals,

Is it possible to have a sub-form in C#? Basically, I am curious if I could attach a small Form inside a larger Form, so the form would be able to drag around inside the larger form. In a way it would be bound to the the larger form.

Any ideas?


Cheers!
0
Comment
Question by:Cyber-Drugs
4 Comments
 
LVL 17

Expert Comment

by:xDJR1875
ID: 18886784
in the properties for the form, set IsMdiContainer = true
0
 
LVL 3

Accepted Solution

by:
RizwanKhalid earned 250 total points
ID: 18887867
1) Create two forms named form1 and form2
2) set from1.IsMdiContainer = true; You can do this in the designer of the form.
3) create a new form2 in some function as form2 frm = new form2();
4) set frm.MdiParent = this; instead of this, you can use the name of form1 whatever it is.

If you want a code snippet of the classes, please ask.
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 250 total points
ID: 18891246
You can have forms as child controls in a parent form, without having to resort to using MDI properties.  

Form2 f = new Form2();
f.TopLevel = false;
f.Parent = this;
f.Show();

Bob
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18913349
Cheers guys!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now