开发者

TOpenDialog in Delphi - how to open only file with given name

开发者 https://www.devze.com 2022-12-13 02:00 出处:网络
User should open only \"KLADR.DBF\" file. I\'m setting \"Filter\" property to \"kladr.dbf\" and dialog shows only required file, but in the same directory there are another \".DBF\" file (STREET.DBF)

User should open only "KLADR.DBF" file. I'm setting "Filter" property to "kladr.dbf" and dialog shows only required file, but in the same directory there are another ".DBF" file (STREET.DBF) and user can open it by typing it's name in "Filename:" edit box. How can I prevent this and let 开发者_C百科users select only required "KLADR.DBF" file?.


TOpenDialog has an event OnCloseQuery. Provide an event handler that checks for the validity of the name, and if the app shouldn't accept the name then show a message to the user and set CanClose to False.

0

精彩评论

暂无评论...
验证码 换一张
取 消