[RESOLVED] [2005] Open File dialog error?
Hi.. I'm having problem with open file dialog
When I first open the program then select(browse) the files, if I press the cancel button, the entry files are not selected(not go to the data grid), but after the first try, if I cancel, the entry from the first try got inserted, Is this bug? I've used filedialog.dispose().. :(
I've tried to put the dispose after showdialog() but it still doesn't work..
here's the code
Code:
FileDialog.ShowDialog()
total = FileDialog.FileNames.Length
uplot = New String(total) {}
If total > 0 Then
dgv_uplot.Rows.Add(total)
End If
FileDialog.Dispose()
For i = 0 To total - 1
uplot(i) = Me.filedialog.FileNames(i).ToString
dgv_uplot.Item(1, baris).Value = uplot(i)
baris += 1
Next
FileDialog.Dispose()
Re: [2005] Open File dialog error?
Quote:
Originally Posted by Pirate
The code inside if statement will get executed only if the user selected a file and presses ok .
Code:
If FileDialog.ShowDialog() = DialogResult.OK Then
total = FileDialog.FileNames.Length
uplot = New String(total) {}
If total > 0 Then
dgv_uplot.Rows.Add(total)
For i = 0 To total - 1
uplot(i) = Me.filedialog.FileNames(i).ToString
dgv_uplot.Item(1, baris).Value = uplot(i)
baris += 1
Next
End If
Thanks.. It's working now :D :D