N
NDB Europe
Hi All,
Sorry but my last post has disapared so appoligies for the repost.
I have a project with Main MDI form called frmMain. I have on there a Split
Container. I also have 2 x UserControls called Form1 & Form2.
When my project starts up I would like UserControl Form1 to populate
splitcontainer.panel1 and Usercontrol Form2 to populate
splitcontainer.panel2.
How can I achive this.
I currently have the following code but it gives me a compile error saying:
Error 1 The type or namespace name 'Form1' could not be found (are you
missing a using directive or an assembly reference?) D:\Winform
Development\Test_Code_Project\Forms\frmMain.cs 19 13 Test_Code_Project
Error 2 The type or namespace name 'Form1' could not be found (are you
missing a using directive or an assembly reference?) D:\Winform
Development\Test_Code_Project\Forms\frmMain.cs 19 31 Test_Code_Project
Error 3 The type or namespace name 'Form2' could not be found (are you
missing a using directive or an assembly reference?) D:\Winform
Development\Test_Code_Project\Forms\frmMain.cs 20 13 Test_Code_Project
Error 4 The type or namespace name 'Form2' could not be found (are you
missing a using directive or an assembly reference?) D:\Winform
Development\Test_Code_Project\Forms\frmMain.cs 20 31 Test_Code_Project
I would be greatfull for any Input you could give.
Code Start:
---------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Test_Code_Project
{
public partial class frmMain : Form
{
private int childFormNumber = 0;
public frmMain()
{
InitializeComponent();
Form1 formA = new Form1();
Form2 formB = new Form2();
formA.TopLevel = false;
formB.TopLevel = false;
splitContainer1.Panel1.Controls.Add(formA);
splitContainer1.Panel2.Controls.Add(formB);
formA.Show();
formB.Show();
}
private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.MdiParent = this;
childForm.Text = "Window " + childFormNumber++;
childForm.Show();
}
private void TileVerticalToolStripMenuItem_Click(object sender,
EventArgs e)
{
LayoutMdi(MdiLayout.TileVertical);
}
private void TileHorizontalToolStripMenuItem_Click(object sender,
EventArgs e)
{
LayoutMdi(MdiLayout.TileHorizontal);
}
private void ArrangeIconsToolStripMenuItem_Click(object sender,
EventArgs e)
{
LayoutMdi(MdiLayout.ArrangeIcons);
}
private void CloseAllToolStripMenuItem_Click(object sender,
EventArgs e)
{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
}
}
private void frmMain_Load(object sender, EventArgs e)
{
}
}
}
Many Thanks
Best Regards
Si
Sorry but my last post has disapared so appoligies for the repost.
I have a project with Main MDI form called frmMain. I have on there a Split
Container. I also have 2 x UserControls called Form1 & Form2.
When my project starts up I would like UserControl Form1 to populate
splitcontainer.panel1 and Usercontrol Form2 to populate
splitcontainer.panel2.
How can I achive this.
I currently have the following code but it gives me a compile error saying:
Error 1 The type or namespace name 'Form1' could not be found (are you
missing a using directive or an assembly reference?) D:\Winform
Development\Test_Code_Project\Forms\frmMain.cs 19 13 Test_Code_Project
Error 2 The type or namespace name 'Form1' could not be found (are you
missing a using directive or an assembly reference?) D:\Winform
Development\Test_Code_Project\Forms\frmMain.cs 19 31 Test_Code_Project
Error 3 The type or namespace name 'Form2' could not be found (are you
missing a using directive or an assembly reference?) D:\Winform
Development\Test_Code_Project\Forms\frmMain.cs 20 13 Test_Code_Project
Error 4 The type or namespace name 'Form2' could not be found (are you
missing a using directive or an assembly reference?) D:\Winform
Development\Test_Code_Project\Forms\frmMain.cs 20 31 Test_Code_Project
I would be greatfull for any Input you could give.
Code Start:
---------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Test_Code_Project
{
public partial class frmMain : Form
{
private int childFormNumber = 0;
public frmMain()
{
InitializeComponent();
Form1 formA = new Form1();
Form2 formB = new Form2();
formA.TopLevel = false;
formB.TopLevel = false;
splitContainer1.Panel1.Controls.Add(formA);
splitContainer1.Panel2.Controls.Add(formB);
formA.Show();
formB.Show();
}
private void ShowNewForm(object sender, EventArgs e)
{
Form childForm = new Form();
childForm.MdiParent = this;
childForm.Text = "Window " + childFormNumber++;
childForm.Show();
}
private void TileVerticalToolStripMenuItem_Click(object sender,
EventArgs e)
{
LayoutMdi(MdiLayout.TileVertical);
}
private void TileHorizontalToolStripMenuItem_Click(object sender,
EventArgs e)
{
LayoutMdi(MdiLayout.TileHorizontal);
}
private void ArrangeIconsToolStripMenuItem_Click(object sender,
EventArgs e)
{
LayoutMdi(MdiLayout.ArrangeIcons);
}
private void CloseAllToolStripMenuItem_Click(object sender,
EventArgs e)
{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
}
}
private void frmMain_Load(object sender, EventArgs e)
{
}
}
}
Many Thanks
Best Regards
Si