|
||||||
| Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
The exception indicates that either WebBrowser1 or WebBrowser1.ActiveXInstance is null...I'm not sure which one, though. If you put a breakpoint on that line and debug, you can use the immediate window to run the following 2 commands:
Code:
?WebBrowser1 ?WebBrowser1.ActiveXInstance Code:
Public Sub New()
InitializeComponent()
' Cast to WebBrowser, so that we can subscribe to the NewWindow3 event
Debug.Assert(WebBrowser1 IsNot Nothing)
Debug.Assert(WebBrowser1.ActiveXInstance IsNot Nothing)
AddHandler DirectCast(WebBrowser1.ActiveXInstance, SHDocVw.WebBrowser).NewWindow3, AddressOf WebBrowser1_NewWindow3
End Sub
|
|
|||
|
Thank you very much for the help. Everything is at least mostly working now.
![]() I have one more little question, then I'll be out of your hair (for a little while at least ) How do I set a wildcard for a URL? For example, in the following codeCode:
' WebBrowser1.Url Is "http://www.writely.com/" Then
WebBrowser1.Navigate(bstrUrl)
Else : System.Diagnostics.Process.Start(bstrUrl)
End If
How would I get it so that http://writely.com/* opens the URL in WebBrowser1, while everything else still opens in the default browser? |
|
|||
|
You could use a RegEx for that - but for your particular scenario, you could just do:
Code:
If Not String.IsNullOrEmpty(bstrUrl) AndAlso bstrUrl.IndexOf("writeley.com") >= 0 Then
' String contains writeley.com
Else
' String does not contain writeley.com
End If
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Object IO Stream Data Loss Possible? Any solution, pls? | reachpradeep | Java Help | 0 | 03-05-2007 03:02 PM |
| object in session.... "<logic:present>" with JSTL? | reachpradeep | Java Help | 0 | 03-04-2007 09:46 AM |
| Regarding Request Object | reachpradeep | Java Help | 0 | 03-03-2007 10:46 AM |
| Object is Null | Lop | C# Programming | 2 | 09-21-2006 12:25 PM |
| Check object for null | Lop | C# Programming | 3 | 07-18-2006 06:56 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |