School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,158 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 4,070 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? Rate Topic: -----

#1 azhan  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 3
  • Joined: 06-June 09


Dream Kudos: 0

Post icon  Posted 06 June 2009 - 10:05 PM

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
Was This Post Helpful? 0
  • +
  • -


#2 paperclipmuffin  Icon User is offline

  • WinWinWinWindows?
  • Icon
  • View blog
  • Group: Authors
  • Posts: 910
  • Joined: 16-April 09


Dream Kudos: 400

Posted 06 June 2009 - 11:22 PM

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. :P

Hope that helps.
Was This Post Helpful? 0
  • +
  • -

#3 azhan  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 3
  • Joined: 06-June 09


Dream Kudos: 0

Posted 07 June 2009 - 12:07 AM

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

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.

<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.
Was This Post Helpful? 0
  • +
  • -

#4 azhan  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 3
  • Joined: 06-June 09


Dream Kudos: 0

Posted 07 June 2009 - 01:45 AM

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


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



Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

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

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month