OpenDialog Filter lazarus / 10-Designer ---------------------------------------------------------------------- Balf · 2011-03-31 09:53 Hello, I am trying to only list .dbf files in the open file dialogue window but I see all file types.  Can anyone tell me what I am doing wrong? Thanks.    var     MyDataFile : string ; begin      if OpenDialog1.Execute then    begin      OpenDialog1.Filter := '*.dbf' ;      MyDataFile := OpenDialog1.FileName ;    end. end ---------------------------------------------------------------------- Mando · 2011-03-31 10:28 Hello: You must set filter before call execute method of the dialog. Code: [Select] var     MyDataFile : string ; begin    OpenDialog1.Filter := 'DBase Table|*.dbf' ;    if OpenDialog1.Execute then          MyDataFile := OpenDialog1.FileName ;   end ... or set it in edit-time in the object inspector. regards. ---------------------------------------------------------------------- Balf · 2011-03-31 11:24 Thanks for that - it almost works!  Is it possible to have a filter expression the way I had it i.e. '*.dbf' as apposed to 'DBase Table|*.dbf' because:  OpenDialog1.Filter := '*.dbf' ;    if OpenDialog1.Execute then          MyDataFile := OpenDialog1.FileName ; doesn't work and my level 7 dbase tables aren't listed when I use  'DBase Table|*.dbf' ---------------------------------------------------------------------- Mando · 2011-03-31 11:30 ¿What is the extension for dbase tables level 7? ---------------------------------------------------------------------- Balf · 2011-03-31 11:40 .dbf ---------------------------------------------------------------------- Balf · 2011-03-31 11:45 It wasn't the table type it was the case of the extension ie it lists all *.dbf but not *.DBF  Is there a way to make it list both? Thanks, Peter ---------------------------------------------------------------------- Blaazen · 2011-03-31 13:49 Some Delphi solution: http://www.delphipages.com/forum/showthread.php?t=193852 Maybe you should try: Code: [Select]OpenDialog1.Filter := '*.dbf; *.DBF'; You are on Windows? Then it case-sensitivity is IMO bug. ---------------------------------------------------------------------- Balf · 2011-03-31 14:06 Thanks. OpenDialog1.Filter := '*.dbf; *.DBF'; selected all file types but OpenDialog1.Filter := 'All Files|*.dbf;*.DBF;' worked I'm on Ubuntu 10 by the way