473,756 Members | 2,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SaveFileDialog + FileName

Hi,

I would like to display only the file names in SaveFileDialog control
when i open it the Window in the without the complete file path

Example

if the file - -- test.doc is in folder c:/abc/test.doc

i would like to display ONLY files "test.doc" in FileNames list or all
*.doc files
and offcourse the filetype is *.doc

example

test.doc
test1.doc
test2.doc

Any help..

Sep 8 '06 #1
8 9440
gopal,

Did you try setting the Filter property? You should be able to do this:

fileDialog.Filt er = "Word files (*.doc)|*.doc";

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"gopal" <go*********@gm ail.comwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
Hi,

I would like to display only the file names in SaveFileDialog control
when i open it the Window in the without the complete file path

Example

if the file - -- test.doc is in folder c:/abc/test.doc

i would like to display ONLY files "test.doc" in FileNames list or all
*.doc files
and offcourse the filetype is *.doc

example

test.doc
test1.doc
test2.doc

Any help..

Sep 8 '06 #2
Yes i tried but the problem is in the FileName Combo Box, i see the
files displayed with full path

namely

c:\documents and settings\test.d oc
c:\project\test .doc
c:\project\test 1.doc

what i need is just the file names be listed without the fullpath
Nicholas Paldino [.NET/C# MVP] wrote:
gopal,

Did you try setting the Filter property? You should be able to do this:

fileDialog.Filt er = "Word files (*.doc)|*.doc";

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"gopal" <go*********@gm ail.comwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
Hi,

I would like to display only the file names in SaveFileDialog control
when i open it the Window in the without the complete file path

Example

if the file - -- test.doc is in folder c:/abc/test.doc

i would like to display ONLY files "test.doc" in FileNames list or all
*.doc files
and offcourse the filetype is *.doc

example

test.doc
test1.doc
test2.doc

Any help..
Sep 8 '06 #3
gopal,

I think this is the way the Windows common dialog works. I doubt it you can
change that.
--
Stoitcho Goutsev (100)

"gopal" <go*********@gm ail.comwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
Yes i tried but the problem is in the FileName Combo Box, i see the
files displayed with full path

namely

c:\documents and settings\test.d oc
c:\project\test .doc
c:\project\test 1.doc

what i need is just the file names be listed without the fullpath
Nicholas Paldino [.NET/C# MVP] wrote:
>gopal,

Did you try setting the Filter property? You should be able to do
this:

fileDialog.Fil ter = "Word files (*.doc)|*.doc";

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"gopal" <go*********@gm ail.comwrote in message
news:11******* *************** @m79g2000cwm.go oglegroups.com. ..
Hi,

I would like to display only the file names in SaveFileDialog control
when i open it the Window in the without the complete file path

Example

if the file - -- test.doc is in folder c:/abc/test.doc

i would like to display ONLY files "test.doc" in FileNames list or all
*.doc files
and offcourse the filetype is *.doc

example

test.doc
test1.doc
test2.doc

Any help..

Sep 8 '06 #4
I'm not quite sure what you mean. Can you show a screen shot showing
what you are talking about?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"gopal" <go*********@gm ail.comwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
Yes i tried but the problem is in the FileName Combo Box, i see the
files displayed with full path

namely

c:\documents and settings\test.d oc
c:\project\test .doc
c:\project\test 1.doc

what i need is just the file names be listed without the fullpath
Nicholas Paldino [.NET/C# MVP] wrote:
>gopal,

Did you try setting the Filter property? You should be able to do
this:

fileDialog.Fil ter = "Word files (*.doc)|*.doc";

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"gopal" <go*********@gm ail.comwrote in message
news:11******* *************** @m79g2000cwm.go oglegroups.com. ..
Hi,

I would like to display only the file names in SaveFileDialog control
when i open it the Window in the without the complete file path

Example

if the file - -- test.doc is in folder c:/abc/test.doc

i would like to display ONLY files "test.doc" in FileNames list or all
*.doc files
and offcourse the filetype is *.doc

example

test.doc
test1.doc
test2.doc

Any help..

Sep 8 '06 #5

Hi,

I am not able to attach the issue as image. the problem goes something
like

In the SaveFileDialog window, below we have two combo boxes

1.FileName - which lists all the files with specified extension given
by us
2.Save as Type - which displays type of file extension namely *.txt

1. FileName combo box - shows the complete path of the files namely

C:\Test1\abc.do c
C:\Test1\abc2.d oc

What i want is FileName comboBox should only display file names namely
abc.doc
abc2.doc


Nicholas Paldino [.NET/C# MVP] wrote:
I'm not quite sure what you mean. Can you show a screen shot showing
what you are talking about?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"gopal" <go*********@gm ail.comwrote in message
news:11******** *************@i 3g2000cwc.googl egroups.com...
Yes i tried but the problem is in the FileName Combo Box, i see the
files displayed with full path

namely

c:\documents and settings\test.d oc
c:\project\test .doc
c:\project\test 1.doc

what i need is just the file names be listed without the fullpath
Nicholas Paldino [.NET/C# MVP] wrote:
gopal,

Did you try setting the Filter property? You should be able to do
this:

fileDialog.Filt er = "Word files (*.doc)|*.doc";

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"gopal" <go*********@gm ail.comwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
Hi,

I would like to display only the file names in SaveFileDialog control
when i open it the Window in the without the complete file path

Example

if the file - -- test.doc is in folder c:/abc/test.doc

i would like to display ONLY files "test.doc" in FileNames list or all
*.doc files
and offcourse the filetype is *.doc

example

test.doc
test1.doc
test2.doc

Any help..
Sep 8 '06 #6
On 8 Sep 2006 04:23:12 -0700, "gopal" <go*********@gm ail.comwrote:
>Hi,

I would like to display only the file names in SaveFileDialog control
when i open it the Window in the without the complete file path

Example

if the file - -- test.doc is in folder c:/abc/test.doc

i would like to display ONLY files "test.doc" in FileNames list or all
*.doc files
and offcourse the filetype is *.doc

example

test.doc
test1.doc
test2.doc

Any help..
If you set the DereferenceLink s Property to false you will not get a list of
files when you open the upper dropdown, but I don't think that was exactly what
you were looking for.

Here is the code:

private void button1_Click(o bject sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog( );
sfd.Dereference Links = false;
sfd.ShowDialog( );
}
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Sep 9 '06 #7

Otis Mukinfus wrote:
On 8 Sep 2006 04:23:12 -0700, "gopal" <go*********@gm ail.comwrote:
Hi,

I would like to display only the file names in SaveFileDialog control
when i open it the Window in the without the complete file path

Example

if the file - -- test.doc is in folder c:/abc/test.doc

i would like to display ONLY files "test.doc" in FileNames list or all
*.doc files
and offcourse the filetype is *.doc

example

test.doc
test1.doc
test2.doc

Any help..

If you set the DereferenceLink s Property to false you will not get a list of
files when you open the upper dropdown, but I don't think that was exactly what
you were looking for.

Here is the code:

private void button1_Click(o bject sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog( );
sfd.Dereference Links = false;
sfd.ShowDialog( );
}
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com


I am not for not showing the list of files, the files shld be
displayed, but only the file names shld be presnt without the full path
of the file

in the File name - drop down/combo box..

Sep 9 '06 #8
On 9 Sep 2006 00:39:14 -0700, "gopal" <go*********@gm ail.comwrote:

[snip]
>If you set the DereferenceLink s Property to false you will not get a list of
files when you open the upper dropdown, but I don't think that was exactly what
you were looking for.

Here is the code:

private void button1_Click(o bject sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog( );
sfd.Dereference Links = false;
sfd.ShowDialog( );
}
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com

I am not for not showing the list of files, the files shld be
displayed, but only the file names shld be presnt without the full path
of the file

in the File name - drop down/combo box..
Sorry I couldn't help, but there may be another way to do this. You could use
your own dialog box for this made from list boxes and drop downs. You would the
FileInfo object to get the file names from the folder the user is in. However
that would be quite a bit of work.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Sep 9 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
19286
by: Ken Allen | last post by:
I have enocuntered something wierd. If I invoke an instance of the above dialog and elect to save the file in a directory where a file of that name does not exist, then the return is DialogResult.OK, but if I elect to save the file on top of a file with the same name in the same directory, when I press the Save button I get a "do you want to overwrite" dialog -- even if I press OK the SaveFileDialog returns DialogResult.Cancel! How...
5
2814
by: juli | last post by:
Hello dear fellows! Is there any chance that you know how can I upload a file with the saveFileDialog control to a specific folder-> I want any file uploaded to be save on specific folder with specific name. Do you know how? Thank you very much!
2
50371
by: Csharper95 | last post by:
I want to get the file name and path from a SaveFileDialog (for a 'save as' operation) after the user has saved the information under a new file name (and presumably under a new path) ? I want to display the new file name and path in the Form.text Title. So how do I go about getting the info ? Heres my code:
3
3128
by: josh | last post by:
How do I make it actually save or open a file? It only opens the dialogs. What do I type to get it to save? Here's what I have so far: Public Class frmMainApp Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code "
6
9183
by: Allen | last post by:
Hi, I want to retrieve the selected folder and entered file name from the SaveFilsDialog. The user is able to create or selected a different folder during the dialog displayed. If user enters "a/b/c/d" in the "File name:" box, then the SaveFileDialog.FileName will return "Path\a\b\c\d" as the name. Is there any way to just retrieve the selected folder and entered file name form the SaveFiledialog?
2
20506
by: ad | last post by:
Hi, I want to use saveFileDialog to save a file (like c:\aa.zip) to another place. How can I assgin c:\aa.zip to saveFileDialog
17
8029
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: I am trying to use the SaveFileDialog class to get a filename, which is subsequently opened for writing (write access, read sharing, but using read/write sharing doesn't make the problem go away anyway). Sometimes, on the statement where I...
2
3959
by: jehugaleahsa | last post by:
Hello: Correct me if I'm wrong, but it appears that saving a file with the SaveFileDialog changes the Environment.CurrentDirectory property. How can I prevent this? Thanks, Travis
3
2785
by: Tony Johansson | last post by:
Hello! The object called dlgOpenFile is of type OpenFileDialog. In this example the eventhandler OnFileOpen is called when the Open File in a menu is clicked. Here we call the OpenFileDialog and select a filename to be opened and then if the Open button is selected we call the OpenFile method.
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.