How to filter filelistbox by masking file types?

Somehow I need to create the usual "open form". I am able to get a list of files with a file list. My question is when I enter this in filelistbox1.mask

Image Files|*.jpg;*.jpeg;*.bmp;*.gif;*.png;*.tiff;*.tga 

all * .jpg files were not displayed, but other image files (.jpeg; .bmp; .gif; .png; .tiff; .tga) appear. how did it happen?

I am sure that there are * .jpg files in the folder, but why didn’t they appear in the list of files?

How to fix my mask? any idea what is the right mask for it?

+4
source share
2 answers

You need to specify only extensions.

 *.jpg;*.jpeg;*.bmp;*.gif;*.png;*.tiff;*.tga 

At least the way I read the documentation.

From the comments you can see that you want to save some friendly text in the control, which indicates what type of file the mask belongs to, for example. image files, executable files, text files, etc. You could reuse the Hint property for this. You can use the Tag property and save the PChar . You can get TFileListBox new class that contains an additional property. Or you can simply save the information in the form class to which the list belongs.

+5
source

Remove Image Files| .
This is for file dialogs.

+2
source

Source: https://habr.com/ru/post/1391933/


All Articles