|
-
Dec 6th, 2008, 03:01 PM
#1
Thread Starter
Junior Member
[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()
-
Dec 6th, 2008, 03:14 PM
#2
Sleep mode
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
-
Dec 7th, 2008, 01:29 AM
#3
Thread Starter
Junior Member
Re: [2005] Open File dialog error?
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|