Basic webage to form

I have a main window that has this code on it :

Private Sub Form_Load()
    Call WebBrowser1.Navigate("http://www.absolutelyhonest.com/demo/chat/stateless/flashchat.php")
End Sub



I want to add another window on the form to load a different website, so I draw the internet tools window, and I get this code :

Private Sub WebBrowser2_StatusTextChange(ByVal Text As String)

End Sub

How come its different to the above address, apart from the website address??

Is it as easy as adding :

Private Sub WebBrowser2_StatusTextChange(ByVal Text As String)
Call WebBrowser2.Navigate("http://www.google.com")
End Sub

To have another page load on the form? Or something like that, because it doesnt work.


This is the complete code of form1 :


Private Sub about_Click()
frmAbout.Show
End Sub

Private Sub Command1_Click()
Dim R As Long
R = ShellExecute(Me.hWnd, "Open", "http://www.jf3000.com/main2.php", vbNullString, vbNullString, vbNormalFocus)
             
'in case of no browser installed, R will be 0
If R = 0 Then
     If MsgBox("No browser installed! Cannot open help file.", vbOKOnly) = vbOK Then
         Exit Sub
     End If
End If
End Sub

Private Sub exit_Click()
Unload Me
End Sub

Private Sub Form_Load()
    Call WebBrowser1.Navigate("http://www.absolutelyhonest.com/demo/chat/stateless/flashchat.php")
End Sub

Private Sub tip_Click()
frmTip.Show
End Sub

Private Sub WebBrowser2_StatusTextChange(ByVal Text As String)

End Sub


I have search the database for an easy solution of adding a webpage to the form, and most answers are left confused, and I even wonder if the person who posted them also understood what the replies meant.

Being new at this, and lerning as I go along is really helpful.

Thank you.

Jf3000

aussiemale33Asked:
Who is Participating?
 
pradapkumarCommented:
you need to paste my code in Form_Load Event immediately below the webbrowser1.navigate method.

Try this.

It can also be called in Form_Activate Event too.

I can't understand why u used the shell command in ur code.
If u have any specific reason for that pls explain me.
If u used it to check whether it works or not it definetly not because the u r trying to open a 'php' file. not a 'html' file. to open it thru shell command u need to configure ur file types and their associated programs to your web browser. Then only it opens that page and returns the handle of the web browser. Then only the R will have some value in it. otherwise the command failures and returns 0 always.
Can u give meaning for >>noob<<?????????????
with regards
Pradap
0
 
pradapkumarCommented:
U can simply add the following line to ur form load event to open another site in another web browser control.

Call WebBrowser2.Navigate("http://www.jf3000.com/main2.php")

No need to call shell commands,

I hope this will solve ur problem.
0
 
aussiemale33Author Commented:
I tried this :

Private Sub WebBrowser2_StatusTextChange(ByVal Text As String)
Call WebBrowser2.Navigate("http://www.google.com")
End Sub


Doesnt work, what ur saying doesnt work. When u start saying no need to call shell commands u r losing me, im a noob, so youll have to explain please.

Thanks for the fast reply too.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
aussiemale33Author Commented:
And this :

Private Sub Form_Load()
    Call WebBrowser2.Navigate("http://www.absolutelyhonest.com/demo/chat/stateless/flashchat.php")
End Sub


Still no go.
0
 
pradapkumarCommented:
try to use
navigate2 method
and give me feedback.
0
 
aussiemale33Author Commented:
Tried :

Private Sub WebBrowser2_StatusTextChange(ByVal Text As String)
Call WebBrowser2.Navigate2("http://www.www.google.com")
End Sub

Still no go.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
As pradapkumar has already said...

If you have two WebBrowser controls (WebBrowser1, WebBrowser2) on your form then you should be able to load up a page in both of them at form load like so:

    Private Sub Form_Load()
        Call WebBrowser1.Navigate2("http://www.absolutelyhonest.com/demo/chat/stateless/flashchat.php")
        Call WebBrowser2.Navigate2("http://www.google.com")
    End Sub

REMOVE the WebBrowser2_StatusTextChange() code!
0
 
aussiemale33Author Commented:
he didnt explain it to me, told you I was a beginner, but thanks idle_mind ur solution has worked for me thank you.
0
 
pradapkumarCommented:
Thanx for ur pointing policy and i appreciate u to finalize this question.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
pradapkumars very first comment explained what to do:

    "U can simply add the following line to ur form load event to open another site in another web browser control."

I just showed what he explained...you should have split the points, or giving them all to him.

You can request the question be reopened so you can distribute points differently here:
http://www.experts-exchange.com/Community_Support/
0
 
aussiemale33Author Commented:
Okay have requested.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
=)
0
 
pradapkumarCommented:
Please leave it if that was not possible. And take it as experience and don't behave like this in future.
0
 
aussiemale33Author Commented:
Dont behave? Excuse me? I asked a simple question, you did not explain it to me as I told you I was new at this. Idle_Mind  replied with what I was trying to do, simple.
0
 
pradapkumarCommented:
SOrry yar.:(
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.