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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect New Window to Self? (WebBrowser Control) 1

Status
Not open for further replies.

CubeE101

Programmer
Joined
Nov 19, 2002
Messages
1,492
Location
US
I'll try to keep this short and sweet ;-)
Let me know if you need further info...

There is a webpage that I want to submit data to, then use the return data to for design purpses...

The problem is... When you click submit, it pops up a new window with the display...

I want to place a WebBrowser object in a VB form, and be able to fill out the controls then submit and return the data in the background...

Is there a way to redirect the New Window's contents to the same WebBrowser control, and cancel the new window request?

If you need an example, here is the form page:

And the pop up data view:

Hmmm... After pasting that URL, I can probably insert the parameters directly into the URL when I navigate the target...
Code:
[URL unfurl="true"]http://www.vamservices.com/V3/html/data/bds.aspx[/URL]
 [b]?d=7          (Diameter)
 &w=29         (Weight)
 &t=0.408      (Thickness)[/b]
 &g=Choose...
 [b]&c=vamfjl     (Connection)
 &a=Regular    (Application)
 &o=IJ         (Option)[/b]
 &u=UM
 &Teff=

But I would still like to know if it can be redirected...

Thanks in advance,
Josh

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
I am sure only a JavaScript porgrammer can reply on this.

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
Why is that?

The WebBrowser control has nothing to do with JavaScript programming?

I am looking for a way to intercept the URL from a NewWindow Request....

Which fires the NewWindow2 Event in VB...

Such as:
Code:
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
  Dim URL As String
  '* Code to intercept URL Here
  '* ...
  '* URL = ???

  '* Block New Window
  Cancel = True
  Dubug.Print "New Window Blocked " & Time

  '* Navigate to intercepted URL
  WebBrowser1.Navigate2 URL
End Sub


Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
See this thread thread222-743922



Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
NICE!!!

Code:
Option Explicit

Dim WithEvents wbx As WebBrowser_V1

Private Sub cmdGo_Click()
  wb1.Navigate2 [i]txtAddress.Text[/i]
  Set wbx = wb1.Object
End Sub

Private Sub wbx_NewWindow(ByVal URL As String, ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant, ByVal Headers As String, Processed As Boolean)
   Processed = True
   wb1.Navigate2 URL
End Sub

Thats exactly what I was looking for, it has the same structure as wb1_BeforeNavigate...

Works Great!!!

Thanks... I gave you a star on the other thread as well...

Couldn't get the other method to work right, though I think I know what was wrong... Any way, it works, that's all that matters...

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top