Easy way to delete files with dialog?

  • Thread starter Thread starter hugh
  • Start date Start date
H

hugh

Hi there,

Is there any way to make a DeleteFileDialog that works
similar with OpenFileDialog? Thanks very much.

Hugh
 
* "hugh said:
Is there any way to make a DeleteFileDialog that works
similar with OpenFileDialog? Thanks very much.

Use the OpenFileDialog to select the file and delete the files
('System.IO.File.Delete') afterwards.
 
-----Original Message-----


Use the OpenFileDialog to select the file and delete the files
('System.IO.File.Delete') afterwards.

Hi Herfried,

Yes, the selected files can be deleted by press "delete"
key. However, OpenfileDialog does not have a "Delete"
button. This is not the way I want. Thanks for help.

Hugh
 
* "Hugh said:
Yes, the selected files can be deleted by press "delete"
key. However, OpenfileDialog does not have a "Delete"
button. This is not the way I want. Thanks for help.

You can change the text, nevertheless, the button will show "Open" as
caption. This can be changed with a dialog hook, but I don't have a
..NET sample here.

\\\
Dim o As New OpenFileDialog
o.Multiselect = True
o.Title = "Select Files to Delete"
If o.ShowDialog() = DialogResult.OK Then
Dim s As String
For Each s In o.FileNames()
System.IO.File.Delete(s)
Next s
End If
///
 
Herfried,

Would you be able to point us to some documentation on how to set it up?
I'm not after a "delete" per se--but I have had the need to change the
dialog box and I'd be interested in studying up on this.

--

RDI

(remove the exclamation from the email address)
 
Hi Herfried,

Yes, I can Override file atribute to change dialog title
and button of OpenFileDialog. Give me some time to try.
Thanks for the tip.

Hugh
 
-----Original Message-----


You can change the text, nevertheless, the button will show "Open" as
caption. This can be changed with a dialog hook, but I don't have a
..NET sample here.

\\\
Dim o As New OpenFileDialog
o.Multiselect = True
o.Title = "Select Files to Delete"
If o.ShowDialog() = DialogResult.OK Then
Dim s As String
For Each s In o.FileNames()
System.IO.File.Delete(s)
Next s
End If
///

Hi Herfried,

Following your tip, I was able to delete file(s) by
pressing "Open" button. But, the button's text is
still "Open". I need to change button text from "Open"
to "Delete". But I do not know how I access to the
button's attribute. I browsed the Window generated code
and got no clue. Any tip?

Thanks.

Hugh
 
Back
Top