FileDialog.Choose

Syntax:

Choose()

Returned value:

Type: Boolean.
If True, the selection/save was successful; if False, the opposite.

Description:

Opens file selection dialog window.

Availability:

Thin client, web-client, thick client.

Note:

To use the method on the web-client, you should preliminarily attach the extension for working with files.

Example:

Dialog = New FileDialog(FileDialogMode.Open);
Dialog.Title = "Select a file with photo";
Dialog.FullFileName = "";
Dialog.Preview = True;
Dialog.Filter = 
"All pictures (*.bmp;*.dib;*.rle;*.jpg;*.jpeg;*.tif;*.gif;*.png;*.ico;*.wmf;*.emf)|*.bmp;*.dib;*.rle;*.jpg;*.jpeg;*.tif;*.gif;*.png;*.ico;*.wmf;*.emf|" 
+ "Format bmp (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|"
+ "Format JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|"
+ "Format TIFF (*.tif)|*.tif|"
+ "Format GIF (*.gif)|*.gif|"
+ "Format PNG (*.png)|*.png|"
+ "Format icon (*.ico)|*.ico|"
+ "Format metafile (*.wmf;*.emf)|*.wmf;*.emf|"; // pictures

If 
Dialog.Choose() Then
    Selection = New Picture(Dialog.FullFileName,False);
    Controls.ImageFiled.Picture = Selection;
Else
    Cancel = True;
    Return
;
EndIf
;


    

1C:Enterprise Developer's Community