Solved

C# - Displaying Subforms

Posted on 2007-04-10
4
1,821 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses

617 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