Option Strict On Imports System.Runtime.InteropServices Public Class Form2 Private WithEvents view As Shell32.ShellFolderView Private Enum FOLDERVIEWMODE As UInteger FVM_ICON = 1UI FVM_SMALLICON = 2UI FVM_LIST = 3UI FVM_DETAILS = 4UI FVM_THUMBNAIL = 5UI FVM_TILE = 6UI FVM_THUMBSTRIP = 7UI End Enum Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.Navigate(System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites)) End Sub Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As _ WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted view = DirectCast(CallByName(WebBrowser1.ActiveXInstance, "Document", CallType.Get), _ Shell32.ShellFolderView) view.CurrentViewMode = FOLDERVIEWMODE.FVM_LIST End Sub Private Function view_DefaultVerbInvoked() As Boolean Handles view.DefaultVerbInvoked Dim fvi1 As Shell32.FolderItems = Nothing Dim fi As Shell32.FolderItem = Nothing Dim sl As Shell32.ShellLinkObject = Nothing Try fvi1 = DirectCast(view.SelectedItems, Shell32.FolderItems) If fvi1 IsNot Nothing Then fi = fvi1.Item(0) If fi.IsLink Then sl = TryCast(fi.GetLink, Shell32.ShellLinkObject) CType(Form1.TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(sl.Path) Me.Close() ElseIf fi.IsFolder Then CallByName(WebBrowser1.ActiveXInstance, "Navigate2", CallType.Method, fi) End If Return False End If Catch ex As Exception Trace.WriteLine(ex.Message) Finally ReleaseComObject(sl) ReleaseComObject(fi) ReleaseComObject(fvi1) End Try Return True End Function Private Function view_BeginDrag() As Boolean Handles view.BeginDrag Return True End Function Private Sub view_EnumDone() Handles view.EnumDone End Sub Private Sub view_SelectionChanged() Handles view.SelectionChanged End Sub Private Function view_VerbInvoked() As Boolean Handles view.VerbInvoked Return True End Function Private Sub ReleaseComObject(Of T)(ByRef o As T) If o IsNot Nothing Then If Marshal.IsComObject(o) Then Marshal.ReleaseComObject(o) End If o = Nothing End If End Sub End Class