Form inside a form?
How Can I add Form inside a form?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Selva GanapathyRank #560 · 4.3K reputationPosted Sep 29, 2014, 6:37 AM EDT
You cant Directly add a Form inside another Form But in MDI, Because Form is a Ultimate Parent, But you can set Owner for a Form, That may help you to provide a relation between forms Like
Form1 form1 = new Form1();
Form2 form2 = new Form2();
form2.Owner = form1;
Regards,
Selva Ganapathy K
VulpesRank #55 · 29.2K reputationPosted Sep 29, 2014, 6:35 AM EDT
VulpesRank #55 · 29.2K reputationPosted Sep 29, 2014, 6:47 AM EDT
using System.Runtime.InteropServices;
// ....
// add this declaration within the parent form:
[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
// now use this code to open the child form within the parent:
VulpesRank #55 · 29.2K reputationPosted Sep 29, 2014, 7:35 AM EDT
nathaJegamoorty Pillai84 reputationPosted Sep 29, 2014, 7:17 AM EDT
nathaJegamoorty Pillai84 reputationPosted Sep 29, 2014, 7:53 AM EDT