WinForm Dialog Control Question

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi,

I have a few questions about using the winform dialog controls:

1) How can I arrange the files based on modified date?
2) There is no equivelent to FileTitle in the common dialog so how can I get
the File Name without the path?
3) I need to have a DeleteFileDialog, how can I do this?

Thanks
 
* "Sam said:
I have a few questions about using the winform dialog controls:

1) How can I arrange the files based on modified date?

Where? In the OpenFileDialog?
2) There is no equivelent to FileTitle in the common dialog so how can I get
the File Name without the path?

'System.IO.Path.GetFileName( said:
3) I need to have a DeleteFileDialog, how can I do this?

Use an OpenFileDialog and delete the selected files with the appropriate
methods from the 'System.IO' namespace ('File.Delete', ...).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Thanks. Yes, I want to arrange the files based on the modified date. Also,
if I use the OpenFileDialog to delete files; how can I change the
button.text to "Delete" instead of "Open"?

Thanks
 
Hi Sam,

I aggree with herfried, there is no easy way to do this.
If you don't want to hook the dialog, maybe you can try

1. Find the handle of the FileDialog
2. Find the handle of the Open button
3. Use SetWindowText API to set the button's Text

This way is not elegant but might be easier.

Also, You may implementing your own FileDialog, Here is an Explorer sample
in C#,
maybe it will be helpful to you:
http://www.codeproject.com/csharp/my_explorer.asp

Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
You should not reply this mail directly, "Online" should be removed before
sending.
 
Back
Top