在file-open-dialog中包括多选项选项
为了允许在file-open-dialog中进行多键执行,并避免了这个长的表达式:
OpenDialogSourceFiles.Options := OpenDialogSourceFiles.Options + [Vcl.Dialogs.fdoAllowMultiSelect]; // works
我尝试使用较短的include
函数:
System.Include(OpenDialogSourceFiles.Options, Vcl.Dialogs.fdoAllowMultiSelect); // error
但是,编译器将其标记为错误。
To allow multiselection in a file-open-dialog and to avoid this long expression:
OpenDialogSourceFiles.Options := OpenDialogSourceFiles.Options + [Vcl.Dialogs.fdoAllowMultiSelect]; // works
I tried to use the shorter Include
function:
System.Include(OpenDialogSourceFiles.Options, Vcl.Dialogs.fdoAllowMultiSelect); // error
However, the compiler marks this as erroneous.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是设计。
include
过程需要一个变量作为其第一个参数(即使该过程是由编译器魔术实现的),但是tfileopendialog,即使该过程实现了
是一个属性。var
参数。选项因此,您必须使用详细的替代方案。您无能为力。
例如,同一件事适用于
inc
和tcomponent.tag
。(但是您可以编写
fdoallowmultiselect
而不是vcl.dialogs.fdoallowmultiselect
,include
而不是system.include
等使其少量详细。This is by design. The
Include
procedure requires a variable as its first argument (it is avar
parameter, essentially, even though the procedure is implemented by compiler magic), butTFileOpenDialog.Options
is a property.Hence you must use the verbose alternative. There's nothing you can do about it.
The same thing applies to
Inc
andTComponent.Tag
, for instance.(But you can write
fdoAllowMultiSelect
instead ofVcl.Dialogs.fdoAllowMultiSelect
,Include
instead ofSystem.Include
, etc. to make it a bit less verbose.)