Imports System.IO Public Class Form1 Friend WithEvents Webbrowser1 As New WebBrowser Friend CheckedListBox1 As New CheckedListBox Friend WithEvents CheckedListBox2 As New CheckedListBox Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Webbrowser1.Dock = DockStyle.Fill Me.CheckedListBox1.Size = New Size(400, 300) Me.CheckedListBox1.Location = New Point(0, 0) Me.CheckedListBox2.Size = New Size(100, 100) Me.CheckedListBox2.Location = New Point(400, 0) Me.Controls.AddRange({Me.Webbrowser1, Me.CheckedListBox1, Me.CheckedListBox2}) Me.CheckedListBox1.BringToFront() Me.CheckedListBox2.BringToFront() Me.Webbrowser1.GoHome() End Sub Private Sub Webbrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles Webbrowser1.DocumentCompleted Me.CheckedListBox1.Items.Clear() Me.CheckedListBox2.Items.Clear() Dim Body As HtmlElement = Me.Webbrowser1.Document.Body Dim Images As HtmlElementCollection = Body.GetElementsByTagName("img") For Each Img As HtmlElement In Images Dim src As String = Img.GetAttribute("src") Dim ext As String = Path.GetExtension(src) Me.CheckedListBox1.Items.Add(src) If Not Me.CheckedListBox2.Items.Contains(ext) Then Me.CheckedListBox2.Items.Add(ext, True) End If Next End Sub Private Sub CheckedListBox2_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles CheckedListBox2.ItemCheck Me.CheckedListBox1.Items.Clear() Dim CheckedItems As New ArrayList CheckedItems.AddRange(Me.CheckedListBox2.CheckedItems) Dim CurrentItem As Object = Me.CheckedListBox2.Items(e.Index) If e.NewValue Then CheckedItems.Add(CurrentItem) Else CheckedItems.Remove(CurrentItem) End If Dim Body As HtmlElement = Me.Webbrowser1.Document.Body Dim Images As HtmlElementCollection = Body.GetElementsByTagName("img") For Each Img As HtmlElement In Images Dim src As String = Img.GetAttribute("src") Dim ext As String = Path.GetExtension(src) If CheckedItems.Contains(ext) Then Me.CheckedListBox1.Items.Add(src) End If Next End Sub End Class