copyright 1999 - 2014 by heinz prelle - hannover  - lenbachstraße 42 - www.visual-basic5.de | impressum
Beispiel: VB .Net - OpenFileDialog - Inhalt in Detailansicht anzeigen
'
Option Explicit On
Option Strict On

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
            Handles Button1.Click
        MessageBox.Show(Me.OpenFileDialogDisplayInDetailView(), "Info")
    End Sub

    Private Function OpenFileDialogDisplayInDetailView() As String
        Dim ofd As OpenFileDialog = New OpenFileDialog()
        Const KeyMessage As String = "{tab}{tab}{tab}{tab}{tab}{right}{right}{down}{up}{enter}"
        Dim FileName As String = String.Empty
        With ofd
            .Title = "Open file..."
            SendKeys.Send(KeyMessage)

            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                FileName = .FileName()
            End If
        End With
        Return FileName
    End Function

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
            Handles MyBase.Load
        With Me
            .Text = "OpenFileDialog - Inhalt in Detailansicht anzeigen"
            .Button1.Text = "Test..."
            .CenterToScreen()
        End With
    End Sub

End Class
Sourcecode Visual Basic