VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 300,309 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,082 people online right now. Registration is fast and FREE... Join Now!




Opening new window in VB browser...how to?

 

Opening new window in VB browser...how to?

azhan

6 Jun, 2009 - 10:05 PM
Post #1

New D.I.C Head
*

Joined: 6 Jun, 2009
Posts: 3

Hello guys!

Im a newbie here, recently im programming PHP for web based approach and i've been using ready made browser like firefox as my application. But now im switching it to custom browser with visual basic. I've created my own custom browser and it seems ok. but my question here is, how to open up a new browser (new VB browser window) as same as we open a new browser in firefox. I've been using html code that opens new window, but it open up explorer browser instead and it took very long time to open. I want it to open up as VB browser with my php codes inside.

Is there any html or php code that could open new vb browser window? instead of explorer or firefox window.

thanks

azhan

User is offlineProfile CardPM
+Quote Post


paperclipmuffin

RE: Opening New Window In VB Browser...how To?

6 Jun, 2009 - 11:22 PM
Post #2

WinWinWinWindows?
Group Icon

Joined: 16 Apr, 2009
Posts: 881



Thanked: 9 times
Dream Kudos: 400
My Contributions
I sugggest you first create a string variable, then set it to the current URL. Open a new instance of your program using the SHELL command and set the startup URL to your string.

I'm not allowed to give you code until you show us yours. tongue.gif

Hope that helps.
User is offlineProfile CardPM
+Quote Post

azhan

RE: Opening New Window In VB Browser...how To?

7 Jun, 2009 - 12:07 AM
Post #3

New D.I.C Head
*

Joined: 6 Jun, 2009
Posts: 3

hurm..im not familiar with the shell thingy, i found one on china server..the VB code is

CODE

Public Class Form1
    Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
        Dim NewURL As String = CType(sender, WebBrowser).StatusText
        Dim frmNew As New Form1
        frmNew.WebBrowser1.Navigate(NewURL)
        '或者是frmNew.WebBrowser1.Url = New Uri(NewURL)
        frmNew.Show()
        e.Cancel = True
    End Sub
End Class


my coding on the current browser is in html like below where it navigates to new window whereby in VB application i already declare the function like code above. So, whenever I click on the html code for new VB window, I manage to open a new window in same VB application.

CODE

<a href="http://www.hyperlinkcode.com/new-window.php" target="_blank">New Browser Window</a>


Now i found the solution already, but do you know how to resize my new VB window to smaller size? I assume we have to edit some at the first VB code that I show.
User is offlineProfile CardPM
+Quote Post

azhan

RE: Opening New Window In VB Browser...how To?

7 Jun, 2009 - 01:45 AM
Post #4

New D.I.C Head
*

Joined: 6 Jun, 2009
Posts: 3

found it...here the new code for opening new window in VB browser application without opening IE pop up..and resize it as desired....huraa..hehe


CODE

Public Class Form1
    Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow

        Dim NewURL As String = CType(sender, WebBrowser).StatusText
        Dim frmNew As New Form1
        frmNew.WebBrowser1.Navigate(NewURL)
        frmNew.Size = New Size(600, 780)
        frmNew.Show()
        e.Cancel = True
    End Sub



End Class


User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 01:49PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month