TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abraham van Wyk
NA
3
0
Parent to Dll form problems
Mar 4 2009 9:00 AM
Hi there.
I have a problem with the parenting in C#. It seems as though I'm missing something. (Searching the web doesn't help).
I want to open multiple forms in a panel on my main form by clicking on a button, but I seem to be doing something wrong. This is the code I'm using:
public IntPtr Handel1;
public Control pannelControl;
private void button1_Click(object sender, EventArgs e)
{
pannelControl = panel1;
Handel1 = pannelControl.Handle;
FORM2 form2 = new FORM2();
form2.TopMost = false;
panel1.Controls.Add(form2);
form2.Show();
}
public partial class FORM2 : Form
{
public void FORM2_Load(object sender, EventArgs e)
{
}
}
First of all, The form is empty. This is the exception I'm getting at the line "panel1.Controls.Add(form2);"
ArgumentException was unhandled
Value does not fall within the expected range.
Reply
Answers (
2
)
joining two datasets
Windows Service Error