Click here to Skip to main content
15,923,845 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How To Populate Data In Another Form Of Display Pin
Eddy Vluggen18-Jul-13 6:38
professionalEddy Vluggen18-Jul-13 6:38 
QuestionVB.net connect to Access with master and child table Pin
dmtp10-Jul-13 11:30
dmtp10-Jul-13 11:30 
AnswerRe: VB.net connect to Access with master and child table Pin
Bernhard Hiller14-Jul-13 21:51
Bernhard Hiller14-Jul-13 21:51 
Questionhow to capture the url of a popup window. Pin
rshaheen9-Jul-13 5:24
rshaheen9-Jul-13 5:24 
AnswerRe: how to capture the url of a popup window. Pin
Dave Kreskowiak9-Jul-13 5:34
mveDave Kreskowiak9-Jul-13 5:34 
GeneralRe: how to capture the url of a popup window. Pin
rshaheen9-Jul-13 6:03
rshaheen9-Jul-13 6:03 
GeneralRe: how to capture the url of a popup window. Pin
Dave Kreskowiak9-Jul-13 6:30
mveDave Kreskowiak9-Jul-13 6:30 
AnswerRe: how to capture the url of a popup window. Pin
Brisingr Aerowing14-Jul-13 12:22
professionalBrisingr Aerowing14-Jul-13 12:22 
VB
Public Delegate Sub NewWindowExtendedEventHandler(ByVal sender As Object, ByVal e As NewWindowExtendedEventArgs)


Public Class NewWindowExtendedEventArgs : CancelEventArgs

  Private url As Uri

  Public ReadOnly Property Url As Uri
  Get
    Return url
  End Get
  End Property

  Public Sub New(ByVal url As Uri)
    Me.url = url
  End Sub

End Class

Public Class ExtendedWebBrowser
	Inherits WebBrowser
	Private Class WebBrowserExtendedEvents
		Inherits System.Runtime.InteropServices.StandardOleMarshalObject
		Implements DWebBrowserEvents2
		Private browser As ExtendedWebBrowser

		Public Sub New(browser As ExtendedWebBrowser)
			Me.browser = browser
		End Sub

		Public Sub NewWindow3(pDisp As Object, ByRef cancel As Boolean, ByRef flags As Object, ByRef urlContext As String, ByRef url As String) Implements ExtendedWebBrowser.DWebBrowserEvents2.NewWindow3
			Dim e As New NewWindowExtendedEventArgs(New Uri(url))
			browser.OnNewWindowExtended(e)
			cancel = e.Cancel
		End Sub
	End Class

	<ComImport> _
	<Guid("34A715A0-6587-11D0-924A-0020AFC7AC4D")> _
	<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)> _
	<TypeLibType(TypeLibTypeFlags.FHidden)> _
	Private Interface DWebBrowserEvents2
		<DispId(273)> _
		Sub NewWindow3(<InAttribute, MarshalAs(UnmanagedType.IDispatch)> pDisp As Object, <InAttribute, OutAttribute> ByRef cancel As Boolean, <InAttribute> ByRef flags As Object, <InAttribute, MarshalAs(UnmanagedType.BStr)> ByRef urlContext As String, <InAttribute, MarshalAs(UnmanagedType.BStr)> ByRef url As String) Implements ExtendedWebBrowser.DWebBrowserEvents2.NewWindow3
	End Interface

	Public Event NewWindowExtended As NewWindowExtendedEventHandler

	Private cookie As AxHost.ConnectionPointCookie
	Private wevents As WebBrowserExtendedEvents

	Protected Overrides Sub CreateSink()
		MyBase.CreateSink()
		wevents = New WebBrowserExtendedEvents(Me)
		cookie = New AxHost.ConnectionPointCookie(Me.ActiveXInstance, wevents, GetType(DWebBrowserEvents2))
	End Sub

	Protected Overrides Sub DetachSink()
		If cookie IsNot Nothing Then
			cookie.Disconnect()
			cookie = Nothing
		End If
		MyBase.DetachSink()
	End Sub

	Protected Overridable Sub OnNewWindowExtended(e As NewWindowExtendedEventArgs)
		RaiseEvent NewWindowExtended(Me, e)
	End Sub
End Class


Hope this helps. I just converted this from the C# code in #Develop. It allows for getting the URL of the event.
brisingr_aerowing@Gryphon-PC $ rake in_the_dough
Raking in the dough

brisingr_aerowing@Gryphon-PC $ make lots_of_money
Making lots_of_money

QuestionVB.NET Windows Service - Detect System Date Time Change Pin
Biplob Singha Shee9-Jul-13 1:03
Biplob Singha Shee9-Jul-13 1:03 
AnswerRe: VB.NET Windows Service - Detect System Date Time Change Pin
Richard Deeming9-Jul-13 1:15
mveRichard Deeming9-Jul-13 1:15 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Biplob Singha Shee9-Jul-13 1:47
Biplob Singha Shee9-Jul-13 1:47 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Richard Deeming9-Jul-13 1:52
mveRichard Deeming9-Jul-13 1:52 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Biplob Singha Shee9-Jul-13 2:02
Biplob Singha Shee9-Jul-13 2:02 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Dave Kreskowiak9-Jul-13 2:42
mveDave Kreskowiak9-Jul-13 2:42 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Richard Deeming9-Jul-13 2:49
mveRichard Deeming9-Jul-13 2:49 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Eddy Vluggen9-Jul-13 3:09
professionalEddy Vluggen9-Jul-13 3:09 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Richard Deeming9-Jul-13 3:11
mveRichard Deeming9-Jul-13 3:11 
AnswerRe: VB.NET Windows Service - Detect System Date Time Change Pin
Biplob Singha Shee9-Jul-13 4:58
Biplob Singha Shee9-Jul-13 4:58 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Richard Deeming9-Jul-13 5:06
mveRichard Deeming9-Jul-13 5:06 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Biplob Singha Shee9-Jul-13 5:23
Biplob Singha Shee9-Jul-13 5:23 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Richard Deeming9-Jul-13 5:49
mveRichard Deeming9-Jul-13 5:49 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Biplob Singha Shee9-Jul-13 5:55
Biplob Singha Shee9-Jul-13 5:55 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Richard Deeming9-Jul-13 6:38
mveRichard Deeming9-Jul-13 6:38 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Biplob Singha Shee9-Jul-13 6:51
Biplob Singha Shee9-Jul-13 6:51 
GeneralRe: VB.NET Windows Service - Detect System Date Time Change Pin
Dave Kreskowiak9-Jul-13 5:28
mveDave Kreskowiak9-Jul-13 5:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.