VectorDraw常见问题整理:如何在OpenFileDialog和SaveFileDialog中
作者:互联网
VectorDraw Developer Framework(VDF)是一个用于应用程序可视化的图形引擎库。有了VDF提供的功能,您可以轻松地创建、编辑、管理、输出、输入和打印2D和3D图形文件。
问:
如果只允许从我的应用程序中打开并保存一些特定的文件类型。例如vdml / vdcl和png文件。怎样才能做到这一点 ?
答:
您需要使用OnGetSaveFileFilterFormat和OnGetOpenFileFilterFormat事件并添加如下代码:
void ActiveDocument_OnGetSaveFileFilterFormat(ref string saveFilter) { string versions = ""; saveFilter = ""; saveFilter += "VDML (*.vdml)|*.vdml|"; versions += "?VDML"; saveFilter += "vdcl (*.vdcl)|*.vdcl|"; versions += "?VDCL"; saveFilter += "PNG (*.png)|*.png|"; versions += "?PNG"; saveFilter += "|"; saveFilter += versions; } void ActiveDocument_OnGetOpenFileFilterFormat(ref string openFilter) { openFilter = "All Drawing Files (*.vdml;*.vdcl;*.png;)|*.vdml;*.vdcl;*.png;"; openFilter += "|VDML Document (*.vdml)|*.vdml"; //add VDML openFilter += "|vdcl Document (*.vdcl)|*.vdcl"; //add VDCL openFilter += "|PNG Files (*.PNG)|*.PNG"; // add PNG openFilter += "|All Files(*.*)|*.*||"; }
标签:png,常见问题,openFilter,VectorDraw,SaveFileDialog,vdml,vdcl,PNG,saveFilter 来源: https://blog.51cto.com/14477114/2445127