请教CommandMethod属性可以有几个参数
<p>各位:</p><p> 在生成 运行在程序级的命令时,需前期选取对象,又要实现文档间复制即程序级命令,如在 CommandMethod属性只能有1个参数,则无法同时完成以上两者功能。</p>
<p> 现请问: CommandMethod属性可以有几个参数吗?即 CommandFlags.UsePickSet和 CommandFlags.Session同时存在于CommandMethod属性中。谢谢!!</p>
<p> </p> <p>没这样试过,你可以试试用或运算连接两种模式</p>
<p>不过应该是不成的</p> <p>直接用下式肯定不行了:</p>
<p><CommandMethod("CopyObj", CommandFlags.Session,CommandFlags.UsePickSet)> _<br/> Public Sub CopyObjects()</p>
<p>不知是否有解决方法?</p>
<p> </p> c#:CommandFlags.Session|CommandFlags.UsePickSet <p>完美解决了,VB.net采用 “+”</p>
<p> <CommandMethod("CopyObj", CommandFlags.Session + CommandFlags.UsePickSet)> _</p>
<p>谢谢各位的帮助!!</p> <font face="Verdana">public CommandMethodAttribute(string globalName);<br/> public CommandMethodAttribute(string globalName, CommandFlags flags);<br/> public CommandMethodAttribute(string groupName, string globalName, CommandFlags flags);<br/> public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags);<br/> public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, string helpTopic);<br/> public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType);<br/> public CommandMethodAttribute(string groupName, string globalName, string localizedNameId, CommandFlags flags, Type contextMenuExtensionType, string helpFileName, string helpTopic);</font> <div id="textstyle_3" style="FONT-SIZE: 12pt; OVERFLOW: hidden; WORD-BREAK: break-all; TEXT-INDENT: 0px; WORD-WRAP: break-word">学习了!谢谢! </div>
页:
[1]