VDF常見(jiàn)問(wèn)題整理(十七):如何初始化具有特定值的bhatch對(duì)話框?
VectorDraw Developer Framework(VDF)是一個(gè)用于應(yīng)用程序可視化的圖形引擎庫(kù)。有了VDF提供的功能,您可以輕松地創(chuàng)建、編輯、管理、輸出、輸入和打印2D和3D圖形文件。
VectorDraw Developer Framework試用版下載
問(wèn):
如果想初始化具有特定值的bhatch對(duì)話框或保留對(duì)話框以前的值,應(yīng)該怎么做?
答:
請(qǐng)檢查下面的代碼,演示如何覆蓋默認(rèn)的bHatch命令實(shí)現(xiàn)并使用特定值調(diào)用對(duì)話框。
void CommandLine_CommandExecute(string commandname, bool isDefaultImplemented, ref bool success) { if (string.Compare(commandname, "bhatch", true) == 0) { vdDocument doc = vdFramedControl1.BaseControl.ActiveDocument; //Set some initial values for the dialog , This can be global to an application so these values can be changed. //You can call the following dialog with a different constructor (with vdHatchproperties) in order to set these values in a global properties application dialog that you may have. vdHatchProperties SetBhatchInitialValues = new vdHatchProperties(); SetBhatchInitialValues.FillMode = VectorDraw.Professional.Constants.VdConstFill.VdFillModeHatchBlock; SetBhatchInitialValues.FillColor.ColorIndex = 0; //Keep in a variable the current ActiveHatchProperties vdHatchProperties KeepActiveHatch = new vdHatchProperties(); KeepActiveHatch.CopyFrom(doc.ActiveHatchProperties); //Set the ActiveHatchProperties to the above value doc.ActiveHatchProperties.CopyFrom(SetBhatchInitialValues); //Call the dialog. vdFigure ret = VectorDraw.Professional.Dialogs.frmGetHatchDialog.Show(null,doc, doc.ActionControl); //Return ActiveHatchProperties values as it was before the dialog. doc.ActiveHatchProperties.CopyFrom (KeepActiveHatch); success = true; return; } }
對(duì)于以上問(wèn)答,如果您有任何的疑惑都可以在評(píng)論區(qū)留言,我們會(huì)及時(shí)回復(fù)。此系列的問(wèn)答教程我們會(huì)持續(xù)更新,如果您感興趣,可以多多關(guān)注本教程。
相關(guān)資料推薦:
VectorDraw Developer Framework(VDF)示例
如果您對(duì)想要購(gòu)買正版授權(quán)VectorDraw Developer Framework(VDF),可以聯(lián)系在線客服>>咨詢相關(guān)問(wèn)題。
關(guān)注慧聚IT微信公眾號(hào) ???,了解產(chǎn)品的最新動(dòng)態(tài)及最新資訊。