RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TFilterComboBox.Mask Property

Specifies the mask associated with the string selected in the filter combo box.

Pascal
property Mask: string;
C++
__property AnsiString Mask;

Read Mask to obtain the mask that was selected by the user. 

When the user uses the filter combo box to select a new filter, the mask associated with the selected file type becomes the value of the Mask property. If a file list box is linked to the filter combo box with the FileList property, the file list will update when the value of Mask changes.  

C++ Examples: 

 

/*
This example uses a filter combo box and a file list box on
a form. When the user selects a filter in the filter combo
box, the file list box displays only files which match the
selected mask:
*/
void __fastcall TForm1::FilterComboBox1Change(TObject *Sender)
{
  FileListBox1->Mask = FilterComboBox1->Mask;
}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  FilterComboBox1->Filter = "All files (*.*)|*.*| Executable files (*.exe)|*.exe";
}

 

Delphi Examples: 

{
This example uses a filter combo box and a file list box on
a form. When the user selects a filter in the filter combo
box, the file list box displays only files which match the
selected mask:
} 
procedure TForm1.FilterComboBox1Change(Sender: TObject);
begin
  FileListBox1.Mask := FilterComboBox1.Mask;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  FilterComboBox1.Filter := 'All files (*.*)|*.*| Pascal files (*.pas)|*.pas';
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!