C++ Builder

La Isla Bonita



OpenDialog: Setting the Filter Property
OpenDialog: Setting the Filter Property


Description

This article describes how to set the Filter and the InitialDir properties of a TOpenDialog component.

OpenDialogFilter.cpp

//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop

#include "OpenDialogFilter.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{

       OpenDialog1->InitialDir = "C:\\Multimedia";
       OpenDialog1->Filter =
       "Multimedia: MPEG AVI ASF MP3 WAV MID|*.mpeg;*.mpg*;.avi;*.asf;\
*.mp3;*.wav;*.mid";
}

Homepage

Copyright © 1997-2002 Rodolfo A. Frino. All rights reserved.