I'm using the OpenfileDialog control. I'm selecting multipal files and everything works great.. except that the dialog box that opens to select the files won't go away. The code behind is in vb.net.. can someone tell me what i'm doing wrong.
Code:1 Private Sub bOpenFileDialog_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles bOpenFileDialog.Click
2 Me.bOpenFileDialog.IsEnabled = False
3 ' Create an instance of the open file dialog box.
4 Dim openFileDialog1 As OpenFileDialog = New OpenFileDialog
5 openFileDialog1 = New OpenFileDialog
6
7 ' Set filter options and filter index.
8 openFileDialog1.Filter = "LOG Files (*.log)|*.log|All Files (*.*)|*.*"
9 openFileDialog1.FilterIndex = 1
10
11 openFileDialog1.Multiselect = True
12
13 ' Call the ShowDialog method to show the dialogbox.
14 Dim UserClickedOK As Boolean = CBool(openFileDialog1.ShowDialog)
15
16 ' Process input if the user clicked OK.
17 If (UserClickedOK = True) Then
18 Dim rows As Integer = openFileDialog1.Files.Count - 1
19 ReDim aryIISLogs(rows)
20
21 For i As Integer = 0 To openFileDialog1.Files.Count - 1
22 aryIISLogs(i) = openFileDialog1.Files(i).Name
23 Next
24 Process1File()
25 End If
26
27 End Sub
1 <Button x:Name="bOpenFileDialog" Content="Select IIS Logs"
2 Height="30" Width="200" Margin="4,15,0,0"
3 HorizontalAlignment="Left" VerticalAlignment="Top"
4 Click="bOpenFileDialog_Click" />