Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webbrowser

Status
Not open for further replies.

Deef666

Programmer
May 15, 2005
9
BE
I've just started programming in C# en have a question. I've been looking on internet on how to make a browser in a windows form.

I have got 3 forms in my project.

- A Login form
- A MDI-form
- A MDI-child

The Login-form contains the main function.
The browser must come in the MDI-child.

I've made the browser with the microsoft control. I even added the MSHTML reference. Now I can compile. But when I open the mdiChild.

Code:
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll

Additional information: Cannot add a top level control to a control.
 
OK,

I found out that it has nothing to do with the browser control. It just because it is a child. I haven't changed a poperty of the form. In VB you need to set a form as child. I didn't found anything like that.

This is what I used as code to open the child.

Code:
frmStartpagina frmStartpagina = new frmStartpagina();
frmStartpagina.Parent = this;
frmStartpagina.Show();
 
ok, I found the problem myself.

It had to be

frmStartpagina.MDIParent = this;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top