MDI Form with Web Browser

G

Guest

I am developing a Application for a Project at Uni, and I have made a web
browser on a form. It works when I have the form as its own window, but when
I put it in a MDI it dorsnt work. Does anyone know a way around this?? thanks
 
B

Bernie Yaeger

Hi Mike,

Give us some more detail. I have a browser working as a child window in an
mdi app with no difficulty - I did nothing special.

Here's my initial code, calling webbrowser.vb, a (mdi child) windows form:
Dim newmdichild As New webbrowser



newmdichild.MdiParent = Me

newmdichild.Show()

Dim nullObject As System.Object = 0

Dim str As String = ""

Dim nullObjStr As System.Object = str



newmdichild.AxWebBrowser1.GoHome()

HTH,

Bernie Yaeger
 
G

Guest

I have the same midi part
BrowserWindow.MDIParent = Me
BrowserWindow.show()

This brings it up ok. But nothing is then displayed. there is a text box on
the page that allows you to enter a if, then it changes the url to the
string. i.e. display.php?page=434.

when the user changes the text box, and clicks go the page= changes. thats
all that happens.

Bernie Yaeger said:
Hi Mike,

Give us some more detail. I have a browser working as a child window in an
mdi app with no difficulty - I did nothing special.

Here's my initial code, calling webbrowser.vb, a (mdi child) windows form:
Dim newmdichild As New webbrowser



newmdichild.MdiParent = Me

newmdichild.Show()

Dim nullObject As System.Object = 0

Dim str As String = ""

Dim nullObjStr As System.Object = str



newmdichild.AxWebBrowser1.GoHome()

HTH,

Bernie Yaeger
 
B

Bernie Yaeger

Hi Mike,

Now I do recall having the same problem before I looked into it a little
further. And then I added this code (which I included before but which you
are not using) AFTER the browserwindow.show():
Dim nullObject As System.Object = 0

Dim str As String = ""

Dim nullObjStr As System.Object = str



newmdichild.AxWebBrowser1.GoHome()

Then, in the browser window itself, I have a button that is set as the
form's acceptbutton called 'goit'. Here is its click event code:

Dim nullObject As System.Object = 0

Dim str As String = ""

Dim nullObjStr As System.Object = str

AxWebBrowser1.Navigate(addressit.Text, nullObject, nullObjStr, nullObjStr,
nullObjStr)

Finally, I have a call to the axwebrowser's documentcomplete event:

Private Sub AxWebBrowser1_DocumentComplete(ByVal sender As Object, ByVal e
As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles
AxWebBrowser1.DocumentComplete

addressit.Text = AxWebBrowser1.LocationURL.ToString

End Sub

I also use toolbars and images for the usual buttons - goback, home,
goforward, etc. If you need some help with these, let me know.

Bernie

Mike Tadd said:
I have the same midi part
BrowserWindow.MDIParent = Me
BrowserWindow.show()

This brings it up ok. But nothing is then displayed. there is a text box
on
the page that allows you to enter a if, then it changes the url to the
string. i.e. display.php?page=434.

when the user changes the text box, and clicks go the page= changes. thats
all that happens.
 
G

Guest

This still dont work. I get too many arguments errors on the navigate. bit of
the code below. Also what does this code do?? anyone else know a way to get
this working, i need it done for my coursework very soon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top