LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File Dialog - Open button (Existing/new file)

Hello,

How do I configure the file dialog to display a "open" button and not a "save" button?
(has been asked before)

I want to open and read an existing file or open a new file and use defaults.
Open Dialog always shows Save button. What does this dialog do; actually save something (empty file e.g.) or .....?
I just want "Open" for EXISTING AND NEW files.

Thanx,

Maser
0 Kudos
Message 1 of 3
(3,139 Views)
Maser,

The open file dialog was built with the assumption that when you select new or existing file, instead of new file, that you are going to be mostly opening a new file. Thus, the dialog is to "save" this new file location, even if it exists.

If you want the dialog to say "Open" instead, you must choose the "existing file" option.

I would suggest that if you are trying to create more accurate dialog for both cases, that you either have a button for each type of dialog (choose New file or open Existing file), or have some other set of code that is dynamic in nature, accounting for when the user might open a new file (i.e. the first time the program is run) or an existing file.

The file dialog does create a new file if none exists, thus the
"save" option. I am not sure, but if a file does exist, and is selected using the "new or existing" option, it probably does open and then save the file without any changes, so save is an accurate dialog.

If you have further questions on the matter, National Instruments support will give you the exact information you are looking for, as they created the file dialog. You can get in touch with NI support at ni.com/ask.
Message 2 of 3
(3,139 Views)
Maser,
The change for this button's text was suggested before, and it will probably take affect in the future release of LabVIEW.
The File Dialog will still perform the same operation. Depending on the "select mode" input, this button will either act as "Save" or "Open" button. If the user can enter a new filename, it will perform "Save", otherwise it will do "Open".

Zvezdana S.
National Instruments
0 Kudos
Message 3 of 3
(3,139 Views)