Display files in a directory list control

两盒软妹~` 提交于 2019-12-01 12:29:29

问题


Is there a way for user to select a specific file using BrowseDlg? All i can find is that you can select only a folder!! I believe File selection is one of the "common" functionality in use.

Can anyone provide some suggestion on how this can be achieved.

Thanks!

Update

I am thinking of creating a C# custom aciton for this, as all other CA in project are in C#. But I am not sure about few things....

  1. How can I sequence this CA dialog with my exsiting UI sequence.
  2. How to trigger a CA on a button click from one of my custom dialog.
  3. How to get the file path back from File Browse CA to be further used by WIX.

The other CAs that I have created does not have any UI associated.

Please advice. Thanks!


回答1:


Actually, Windows Installer doesn't have anything built-in for the "Browse for file" dialog. Various vendors offer their custom solutions, like Advanced Installer and InstallShield.

Anyway, this all ends up in a custom dialog and custom action for Browse button. You can find an example of this here (search for "File Browse Dialog" on that page). The package you'll find contains the custom action, sample solution and some notes. It is based on InstallShield, but you can take at least custom action from there (creating a custom dialog in WiX is not that hard). As a last resort, you can try to implement this CA yourself.



来源:https://stackoverflow.com/questions/4491614/display-files-in-a-directory-list-control

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!