Konu 23,5 : İnternet Explorer Tablı

Örnek Uygulama için tıklayın

Ekran Görüntüsü

konu235  

Kod

Public Class Form1
    Dim wb As WebBrowser
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        wb = WebBrowser1
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        wb.Navigate("http://google.com")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If Not ComboBox1.Text.StartsWith("http://") And Not ComboBox1.Text.StartsWith("https://") Then
            ComboBox1.Text = "http://" & ComboBox1.Text
        End If
        wb.Navigate(ComboBox1.Text)
    End Sub

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

        Dim hangisi As TabPage = sender.Parent
        hangisi.Text = sender.DocumentTitle
    End Sub

    Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
        If e.CurrentProgress >= 0 And e.CurrentProgress <= e.MaximumProgress Then
            ProgressBar1.Maximum = e.MaximumProgress
            ProgressBar1.Value = e.CurrentProgress
        End If


    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        wb.GoBack()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        wb.GoForward()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        wb.Refresh()
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim yeniTab As TabPage = New TabPage
        yeniTab.Text = ""
        TabControl1.TabPages.Insert(TabControl1.TabPages.Count - 1, yeniTab)

        Dim yeniWeb As WebBrowser = New WebBrowser
        yeniWeb.ScriptErrorsSuppressed = True
        yeniWeb.Dock = DockStyle.Fill
        yeniTab.Controls.Add(yeniWeb)

        AddHandler yeniWeb.DocumentCompleted, AddressOf WebBrowser1_DocumentCompleted
        AddHandler yeniWeb.ProgressChanged, AddressOf WebBrowser1_ProgressChanged

        TabControl1.SelectedTab = yeniTab
    End Sub



    Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
        If TabControl1.SelectedIndex = TabControl1.TabPages.Count - 1 Then
            Button6.PerformClick()
        Else
            Dim secilenTab As TabPage = TabControl1.SelectedTab
            Dim secilenWeb As WebBrowser = secilenTab.Controls(0)
            wb = secilenWeb
        End If


    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Dim secilenIndex As Integer = TabControl1.SelectedIndex
        If TabControl1.TabPages.Count > 2 Then
            TabControl1.SelectedTab.Dispose()
        End If

        If secilenIndex < TabControl1.TabPages.Count - 1 Then
            TabControl1.SelectedIndex = secilenIndex
        Else
            TabControl1.SelectedIndex = secilenIndex - 1
        End If

    End Sub
End Class

     

Konu 23: Internet explorer tablı görünüm örneği

Örnek Uygulama

Ekran Görüntüsü

Public Class Form1
    Dim gezente As WebBrowser
    Dim sayi As Integer = 2
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        gezente.Navigate("http://www.google.com")
    End Sub

    Sub yenisayfada(ByVal url As String)
        Dim sayfa As New TabPage
        Dim gez As New WebBrowser
        TabControl1.TabPages.Add(sayfa)
        sayfa.Controls.Add(gez)
        sayfa.Text = "sayfa" & sayi
        sayi += 1
        gez.Dock = DockStyle.Fill
        TabControl1.SelectedTab = sayfa
        gez.Navigate(url)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If ComboBox1.Text.StartsWith("http://") = False Then
            ComboBox1.Text = ComboBox1.Text.Insert(0, "http://")
        End If

        If RadioButton2.Checked = True Then
            'ayni sayfada
            gezente.Navigate(ComboBox1.Text)
        Else
            'farkli sayfada
            yenisayfada(ComboBox1.Text)
        End If

    End Sub

    Private Sub gezente_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs)

        If e.CurrentProgress = 0 Then
            pb.Value = 0
            Exi t Sub
        End If

        pb.Value = (100 * e.CurrentProgress) / e.MaximumProgress

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        pb.Maximum = 100
        gezente = WebBrowser1
        AddHandler gezente.ProgressChanged, AddressOf gezente_ProgressChanged
    End Sub

    Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
        Dim secilen As TabPage
        secilen = TabControl1.SelectedTab
        If secilen Is Nothing = True Then
            Exi t Sub
        End If

        gezente = secilen.Controls(0)
        AddHandler gezente.ProgressChanged, AddressOf gezente_ProgressChanged
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        TabControl1.SelectedTab.Dispose()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        TabControl1.TabPages.Clear()
        sayi = 1
        yenisayfada("www.google.com")
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        gezente.GoBack()
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        gezente.GoForward()
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        gezente.Refresh()
    End Sub
End Class

Konu 22: Webbrowser İnternetexplorer Uygulaması (Tablı) Bölüm 2

Örnek Uygulama

Ekran Görüntüsü

Public Class Form1
    Sub yenisayfa(ByVal url As String)
        Dim sayfa As New TabPage
        Dim web As New WebBrowser
        web.Dock = DockStyle.Fill
        sayfa.Controls.Add(web)
        TabControl1.TabPages.Add(sayfa)
        web.Navigate(url)
        AddHandler web.ProgressChanged, AddressOf ilerleme
        sayfa.Text = url
        TabControl1.SelectedTab = sayfa
    End Sub
    Sub aynisayfa(ByVal url As String)
        Dim secilen As TabPage
        secilen = TabControl1.SelectedTab
        Dim secilenweb As WebBrowser
        secilenweb = secilen.Controls(0)
        secilenweb.Navigate(url)
        secilen.Text = url
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        yenisayfa("www.google.com")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If RadioButton1.Checked Then
            yenisayfa(ComboBox1.Text)
        ElseIf RadioButton2.Checked Then
            aynisayfa(ComboBox1.Text)
        End If

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim secilen As TabPage
        secilen = TabControl1.SelectedTab
        If secilen Is Nothing = False Then
            secilen.Dispose()
        End If

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim sayfa As TabPage
        For Each sayfa In TabControl1.TabPages
            sayfa.Dispose()
        Next
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim secilen As TabPage
        secilen = TabControl1.SelectedTab
        Dim secilenweb As WebBrowser
        secilenweb = secilen.Controls(0)
        secilenweb.Refresh()
    End Sub

    Private Sub ilerleme(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs)
        If e.CurrentProgress < 0 Then
            ProgressBar1.Value = 0
            Exi t Sub
        End If
        If ProgressBar1.Value = 100 Then
            ProgressBar1.Value = 0
            Exi t Sub
        End If
        ProgressBar1.Value = (e.CurrentProgress * 100) / e.MaximumProgress

    End Sub

End Class

Konu 21: Webbrowser İnternetexplorer Uygulaması (Tablı) Bölüm 1

Örnek Uygulama

Ekran Görüntüsü

Public Class Form1

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        If RadioButton1.Checked Then
            'aynı sayfada ac
            aynisayfa(cb.Text)
        ElseIf RadioButton2.Checked Then
            'yeni sayfada ac
            yenisayfa(cb.Text)
        End If
    End Sub

    Sub aynisayfa(ByVal url As String)
        Dim secilen As TabPage
        secilen = TabControl1.SelectedTab
        Dim secilenWeb As WebBrowser
        secilenWeb = secilen.Controls(0)
        secilenWeb.Navigate(url)
        secilen.Text = url
    End Sub

    Sub yenisayfa(ByVal url As String)
        Dim yeni As New TabPage
        Dim web As New WebBrowser
        yeni.Controls.Add(web)
        web.Dock = DockStyle.Fill
        TabControl1.TabPages.Add(yeni)
        web.Navigate(url)
        yeni.Text = url
        TabControl1.SelectedTab = yeni
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim yeni As New TabPage
        Dim web As New WebBrowser
        yeni.Controls.Add(web)
        web.Dock = DockStyle.Fill
        TabControl1.TabPages.Add(yeni)
        web.Navigate("www.google.com")
        yeni.Text = "www.google.com"
    End Sub

    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        TabControl1.Left = 0
        TabControl1.Width = Me.Width
        TabControl1.Height = Me.Height - 75
        TabControl1.Top = 75
    End Sub
End Class

Konu 20: Webbrowser İnternetexplorer Uygulaması

Örnek Uygulama

Ekran Görüntüsü

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Navigate("http://www.google.com")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If ComboBox1.Text.StartsWith("http://") Then
            WebBrowser1.Navigate(ComboBox1.Text)
        Else
            ComboBox1.Text = ComboBox1.Text.Insert(0, "http://")
            WebBrowser1.Navigate(ComboBox1.Text)
        End If

    End Sub

    Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged

        If e.CurrentProgress = -1 Then
            pb.Value = 0
            Exi t Sub
        End If

        pb.Value = (100 * e.CurrentProgress) / e.MaximumProgress

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        pb.Maximum = 100
    End Sub
End Class

Konu 19: Richtextbox Nesnesi Ve Word Pad Örneği (Tablı)

Örnek Uygulama

Ekran Görüntüsü

Public Class Form1
    Dim rtb1 As RichTextBox
    Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
        ofd1.Filter = "zengin metin belgesi | *.rtf"
        If ofd1.ShowDialog = Windows.Forms.DialogResult.OK Then
            rtb1.LoadFile(ofd1.FileName)

        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        sfd1.Filter = "zengin metin belgesi | *.rtf"
        If sfd1.ShowDialog = Windows.Forms.DialogResult.OK Then
            rtb1.SaveFile(sfd1.FileName)
        End If
    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged, RadioButton3.CheckedChanged, RadioButton4.CheckedChanged
        If RadioButton1.Checked = True Then
            rtb1.SelectionFont = New Font("Verdana", 12, FontStyle.Regular)
        ElseIf RadioButton2.Checked Then
            rtb1.SelectionFont = New Font("Verdana", 12, FontStyle.Bold)
        ElseIf RadioButton3.Checked Then
            rtb1.SelectionFont = New Font("Verdana", 12, FontStyle.Italic)
        ElseIf RadioButton4.Checked Then
            rtb1.SelectionFont = New Font("Verdana", 12, FontStyle.Underline)
        End If

        rtb1.Focus()
    End Sub

    Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged, RadioButton6.CheckedChanged, RadioButton7.CheckedChanged
        If RadioButton5.Checked Then
            rtb1.SelectionAlignment = HorizontalAlignment.Right
        ElseIf RadioButton6.Checked Then
            rtb1.SelectionAlignment = HorizontalAlignment.Left
        ElseIf RadioButton7.Checked Then
            rtb1.SelectionAlignment = HorizontalAlignment.Center
        End If
        rtb1.Focus()
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked Then
            rtb1.SelectionBullet = True
        Else
            rtb1.SelectionBullet = False
        End If
        rtb1.Focus()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If cd1.ShowDialog = Windows.Forms.DialogResult.OK Then
            rtb1.SelectionColor = cd1.Color
        End If
        rtb1.Focus()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TabC.TabPages.Add("yeni")
        Dim rtb As New RichTextBox
        TabC.TabPages(TabC.TabPages.Count - 1).Controls.Add(rtb)
        rtb.Dock = DockStyle.Fill
        TabC.SelectedIndex = 0
        rtb1 = TabC.SelectedTab.Controls(0)

        'ProgressBar1.Maximum = 200
    End Sub

    Private Sub rtb1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        ProgressBar1.Value = rtb1.TextLength

        Dim r, g, b As Integer
        r = Rnd() * 255
        g = Rnd() * 255
        b = Rnd() * 255
        rtb1.SelectionColor = Color.FromArgb(255, r, g, b)
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        TabC.TabPages.Add("yeni")
        Dim rtb As New RichTextBox
        TabC.TabPages(TabC.TabPages.Count - 1).Controls.Add(rtb)
        rtb.Dock = DockStyle.Fill
        TabC.SelectedIndex = TabC.TabPages.Count - 1

        rtb1 = TabC.SelectedTab.Controls(0)

    End Sub

    Private Sub TabC_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabC.SelectedIndexChanged
        rtb1 = TabC.SelectedTab.Controls(0)
        ProgressBar1.Maximum = rtb1.MaxLength

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        TabC.SelectedTab.Dispose()

    End Sub
End Class

Konu 18: Richtextbox Nesnesi Ve Word Pad Örneği

Örnek Uygulama

Ekran Görüntüsü

030714_2122_Konu17Richt11

Public Class Form1

    Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
        ofd1.Filter = "zengin metin belgesi | *.rtf"
        If ofd1.ShowDialog = Windows.Forms.DialogResult.OK Then
            rtb1.LoadFile(ofd1.FileName)
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        sfd1.Filter = "zengin metin belgesi | *.rtf"
        If sfd1.ShowDialog = Windows.Forms.DialogResult.OK Then
            rtb1.SaveFile(sfd1.FileName)
        End If
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged, CheckBox3.CheckedChanged
        Dim sayi As Byte = 0

        If CheckBox1.Checked Then
            sayi += 1
        End If
        If CheckBox2.Checked Then
            sayi += 2
        End If
        If CheckBox3.Checked Then
            sayi += 4
        End If
        Dim fnt As FontStyle = sayi
        RichTextBox1.SelectionFont = New Font("Arial", 8, fnt)

        RichTextBox1.Focus()
    End Sub

    Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged, RadioButton6.CheckedChanged, RadioButton7.CheckedChanged
        If RadioButton5.Checked Then
            rtb1.SelectionAlignment = HorizontalAlignment.Right
        ElseIf RadioButton6.Checked Then
            rtb1.SelectionAlignment = HorizontalAlignment.Left
        ElseIf RadioButton7.Checked Then
            rtb1.SelectionAlignment = HorizontalAlignment.Center
        End If
        rtb1.Focus()
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked Then
            rtb1.SelectionBullet = True
        Else
            rtb1.SelectionBullet = False
        End If
        rtb1.Focus()
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If cd1.ShowDialog = Windows.Forms.DialogResult.OK Then
            rtb1.SelectionColor = cd1.Color
        End If
        rtb1.Focus()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ProgressBar1.Maximum = rtb1.MaxLength
        'ProgressBar1.Maximum = 200
    End Sub

    Private Sub rtb1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rtb1.TextChanged
        ProgressBar1.Value = rtb1.TextLength

        Dim r, g, b As Integer
        r = Rnd() * 255
        g = Rnd() * 255
        b = Rnd() * 255
        rtb1.SelectionColor = Color.FromArgb(255, r, g, b)
    End Sub
End Class

Konu 17: Tabcontrol Nesnesi

Örnek Uygulama

Ekran Görüntüsü

Public Class Form1
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Label1.Text = "merhaba"
        tc1.TabPages(0).Text = "merhaba"
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim lab As New Label
        lab.Text = "deneme"
        tc1.TabPages.Add("tp1", "merhaba2")
        tc1.TabPages("tp1").Controls.Add(lab)
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        tc1.TabPages.RemoveAt(1)
    End Sub

    Private Sub tc1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tc1.SelectedIndexChanged
        Label2.Text = tc1.SelectedTab.Text
    End Sub
End Class

Konu 16: Checkbox, Radiobutton, Groupbox, H-V Scrollbar, Trackbar, Datetimepicker, Numerik-Domain Updown

Örnek Uygulama

Ekran Görüntüsü

Public Class Form1

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged, RadioButton3.CheckedChanged
        Label1.Text = sender.Text

    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked = True Then
            GroupBox1.Enabled = True
        Else
            GroupBox1.Enabled = False
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DtPicker1.Value = Now
    End Sub

    Private Sub DtPicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DtPicker1.ValueChanged
        Label2.Text = DtPicker1.Value.Date
        Label3.Text = DtPicker1.Value.DayOfYear
    End Sub

    Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll
        Label5.Text = HScrollBar1.Value
        Label4.Left = 290 + HScrollBar1.Value * 2
    End Sub

    Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar1.Scroll
        Label5.Text = VScrollBar1.Value
        Label4.Top = 5 + VScrollBar1.Value * 2
    End Sub

    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll, TrackBar2.Scroll, TrackBar3.Scroll
        Label4.BackColor = Color.FromArgb(255, TrackBar1.Value, TrackBar2.Value, TrackBar3.Value)
    End Sub
End Class

Konu 15: Treeview, Listview, İmagelist Kullanarak Yapılmış Windows Gezgini Programı

Örnek Uygulama

Ekran Görüntüsü

Imports System.Runtime.InteropServices

Public Class Form1
    'dosya resimlerini gorebilmek icin gereken kod blogu
    '****************************************************
    Private Structure SHFILEINFO
        Public hIcon As IntPtr ' : icon
        Public iIcon As Integer ' : icondex
        Public dwAttributes As Integer ' : SFGAO_ flags
        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> _
        Public szDisplayName As String
        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> _
        Public szTypeName As String
    End Structure

    Private Declare Ansi Function SHGetFileInfo Lib "shell32.dll" (ByVal pszPath As String, _
    ByVal dwFileAttributes As Integer, ByRef psfi As SHFILEINFO, ByVal cbFileInfo As Integer, _
    ByVal uFlags As Integer) As IntPtr

    Private Const SHGFI_ICON = &H100
    Private Const SHGFI_SMALLICON = &H1
    Private Const SHGFI_LARGEICON = &H0         ' Large icon
    Private nIndex = 1
    '********************************************************

    Dim surucu As String
    Dim hangisi As TreeNode
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboBox1.DataSource = System.IO.Directory.GetLogicalDrives
        ComboBox1.SelectedIndex = 0

        ListView1.Columns.Add("adı", 100, HorizontalAlignment.Left)
        ListView1.Columns.Add("boyut", 50, HorizontalAlignment.Left)
        ListView1.Columns.Add("tür", 150, HorizontalAlignment.Left)
        ListView1.Columns.Add("yol", 150, HorizontalAlignment.Left)
        ListView1.Columns.Add("zaman", 150, HorizontalAlignment.Left)

        ListView1.View = View.Details

        ListView1.SmallImageList = imageList1
        ListView1.LargeImageList = imageList2

        TreeView1.ImageList = imageList3
        TreeView1.ImageIndex = 0
        TreeView1.SelectedImageIndex = 1
    End Sub

    Sub klasorbul(ByVal root As String)
        'kok dizinde klasorleri bulmak icin kullanılır
        For Each bulunan As String In My.Computer.FileSystem.GetDirectories(root)
            Dim klasor As String
            klasor = bulunan.Remove(0, root.Length)
            TreeView1.Nodes.Add(klasor)
            hangisi = TreeView1.Nodes(TreeView1.Nodes.Count - 1)
            altklasorbul(bulunan)
            hangisi = TreeView1.Nodes(TreeView1.Nodes.Count - 1)
        Next
    End Sub

    Sub altklasorbul(ByVal bulunan As String)
        'belirtilen yolun alt klasorlerini bulmak icin kullanılır
        On Error Resume Next
        For Each bulunanalt As String In My.Computer.FileSystem.GetDirectories(bulunan)
            Application.DoEvents()
            Dim klasor As String
            klasor = bulunanalt.Remove(0, bulunan.Length + 1)
            Dim secilen As TreeNode = hangisi
            secilen.Nodes.Add(klasor)
            hangisi = secilen.Nodes(secilen.Nodes.Count - 1)
            'altklasorbul(bulunanalt)
            If secilen.Parent Is Nothing = True Then
                hangisi = TreeView1.Nodes(TreeView1.Nodes.Count - 1)
            Else
                hangisi = secilen.Parent.Nodes(secilen.Parent.Nodes.Count - 1)
            End If
        Next

    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        TreeView1.Nodes.Clear()
        surucu = ComboBox1.SelectedItem
        klasorbul(ComboBox1.SelectedItem)
        TreeView1.CollapseAll()
        ComboBox1.Text = surucu
    End Sub

    Private Sub TreeView1_AfterExpand(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterExpand
        'treeviewda herhangi bir dugumun + isaretine basıldıgında
        'icindeki klasorlerin alt klasorlerini alır
        Dim yol As String = surucu & e.Node.FullPath
        ComboBox1.Text = yol
        On Error Resume Next
        Dim i As Integer = 0
        For Each bulunan As String In My.Computer.FileSystem.GetDirectories(yol)
            hangisi = e.Node.Nodes(i)
            altklasorbul(bulunan)
            i = i + 1
        Next
    End Sub

    Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
        'treeviewda secim yapıldıgında listviewa klasorleri ve dosyalari listeler

        ListView1.Items.Clear()
        On Error Resume Next
        Dim yol As String = surucu & e.Node.FullPath
        For Each bulunan As String In My.Computer.FileSystem.GetDirectories(yol)
            Dim sonuc As String = bulunan.Remove(0, yol.Length + 1)
            ListView1.Items.Add(sonuc, 0)
        Next

        Dim dosyaboyut As String = ""
        Dim klasor As New IO.DirectoryInfo(yol)

        Dim dosyadizi As IO.FileInfo() = klasor.GetFiles("*.*")
        Dim dosya As IO.FileInfo
        For Each dosya In dosyadizi

            dosyaboyut = (Math.Round(dosya.Length / 1024)).ToString()
            Dim oge As New ListViewItem(dosya.Name)
            oge.SubItems.Add(dosyaboyut)
            oge.SubItems.Add(dosya.Extension)
            oge.SubItems.Add(dosya.FullName)
            oge.SubItems.Add(dosya.LastAccessTime)
            Dim resimno As Integer = resimgoster(dosya.FullName)
            oge.ImageIndex = resimno
            ListView1.Items.Add(oge)
        Next

    End Sub

    Function resimgoster(ByVal yol As String) As Integer
        'dosyaların resimlerinin gorunmesini saglayan bolum
        Dim hImgSmall As IntPtr  'The handle to the system image list.
        Dim hImgLarge As IntPtr  'The handle to the system image list.
        Dim fName As String      'The file name to get the icon from.
        Dim shinfo As SHFILEINFO
        shinfo = New SHFILEINFO()

        shinfo.szDisplayName = New String(Chr(0), 260)
        shinfo.szTypeName = New String(Chr(0), 80)

        fName = yol
        'Use this to get the small icon.
        hImgSmall = SHGetFileInfo(fName, 0, shinfo, Marshal.SizeOf(shinfo), _
            SHGFI_ICON Or SHGFI_SMALLICON)

        'Use this to get the large icon.
        hImgLarge = SHGetFileInfo(fName, 0, shinfo, Marshal.SizeOf(shinfo), _
            SHGFI_ICON Or SHGFI_LARGEICON)

        'The icon is returned in the hIcon member of the shinfo struct.
        Dim myIcon As System.Drawing.Icon
        myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon)

        imageList1.Images.Add(myIcon) 'Add icon to imageList.
        imageList2.Images.Add(myIcon)

        'ListView1.Items.Add(fName, nIndex) 'Add file name and icon to listview.
        nIndex = nIndex + 1

        resimgoster = nIndex - 1
    End Function

    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        'listviewin gorunumunun ayarlandıgı bolum
        Select Case ComboBox2.SelectedItem
            Case "detay"
                ListView1.View = View.Details
            Case "buyuk"
                ListView1.View = View.LargeIcon
            Case "liste"
                ListView1.View = View.List
            Case "kucuk"
                ListView1.View = View.SmallIcon
            Case "tile"
                ListView1.View = View.Tile
        End Select
    End Sub
End Class