Note that there are some explanatory texts on larger screens.

plurals
  1. POsilverlight OpenFileDialog opens a second time
    text
    copied!<p>I'm using the openFileDialog in sliverlight 2.0 with vb.net in the back end. I have it wired up and it is working as it is suppose to except that the click event seems to fire twice. It fires the first time, i select the files and click ok. it does the processing. But as soon as i click ok, the click event fires a second time and the dialog box comes up again. that is not what i want and i'm not sure what i'm doing wrong that it comes up that second time. Here is the code.. hopefully someone see's what i'm doing wrong.</p> <pre><code>&lt;Button x:Name="bOpenFileDialog" Content="2. Import CSV" Height="30" Width="200" Margin="0,96,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Click="bOpenFileDialog_Click" /&gt; &lt;TextBlock Height="19" Margin="246,26,261,0" VerticalAlignment="Top" Text="TextBlock" TextWrapping="Wrap" x:Name="lblMsg"/&gt; Private Sub bOpenFileDialog_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles bOpenFileDialog.Click Me.bOpenFileDialog.IsEnabled = False ' Create an instance of the open file dialog box. Dim openFileDialog1 As OpenFileDialog = New OpenFileDialog ' Set filter options and filter index. openFileDialog1.Filter = "LOG Files (*.log)|*.log|All Files (*.*)|*.*" openFileDialog1.FilterIndex = 1 openFileDialog1.Multiselect = True ' Call the ShowDialog method to show the dialogbox. Dim UserClickedOK As Boolean = CBool(openFileDialog1.ShowDialog) ' Process input if the user clicked OK. If (UserClickedOK = True) Then Dim rows As Integer = openFileDialog1.Files.Count - 1 ReDim aryIISLogs(rows) For i As Integer = 0 To openFileDialog1.Files.Count - 1 aryIISLogs(i) = openFileDialog1.Files(i).Name Next Process1File() End If End Sub </code></pre> <p>Thanks Shannon</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload