Solved

C# - Displaying Subforms

Posted on 2007-04-10
4
1,814 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:Daniel Reynolds
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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