Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the new TFileOpenDialog and the old TOpenDialog?

What is the difference between the new TFileOpenDialog and the old TOpenDialog?
In my computer (Win 7/DXE), when I run the code, the dialogs look the same.

like image 317
Server Overflow Avatar asked Jun 04 '11 10:06

Server Overflow


1 Answers

TOpenDialog executes TFileOpenDialog when the following conditions are met:

  1. the program is running under Vista (and up)
  2. UseLatestCommonDialogs is true (which is the default)
  3. no OnIncludeItem, OnClose or OnShow events are set

So while still using TOpenDialog on your system you may likely end up automagically executing TFileOpenDialog in most cases, which explains why they are looking the same for you.

Remark: TFileOpenDialog does not fall back on older Windows systems (XP and under) - it just raises an exception. On the opposite, TOpenDialog does some sort of "fall forward".

like image 100
Uwe Raabe Avatar answered Oct 02 '22 08:10

Uwe Raabe