Ca4nul @ facebook Ca4nul @ Twitter
Forum announcement: $$ Top Contributors Contest (March 2010) - Win Instant extra Cash $$
Welcome Guest Search | Active Topics | Members | Log In | Register

problem with silverlights OpenFileDialog control Options
steven
Posted: Monday, July 06, 2009 9:40:46 AM
Rank: Advanced Member
Groups: Member

Joined: 4/3/2008
Posts: 117
Points: 351
Location: Sheffield, UK
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" />

 
Sponsor
Posted: Monday, July 06, 2009 9:40:46 AM
richard
Posted: Monday, July 06, 2009 9:43:30 AM
Rank: Advanced Member
Groups: Member

Joined: 6/9/2008
Posts: 149
Points: 447
Location: California, USA
had the event registered twice



Click="bOpenFileDialog_Click"
and then in the code behind

Private Sub bOpenFileDialog_Click(ByVal sender As Object, ByVal e As System.Windows
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by Ca4nul.Com
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.809 seconds.