cl991036
管理员
管理员
  • 注册日期2003-07-25
  • 发帖数5917
  • QQ14265545
  • 铜币29669枚
  • 威望217点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • GIS帝国铁杆
阅读:993回复:0

在ArcGisEngine 开发中如何在Toolbar控件上添加Combobox等其他控件

楼主#
更多 发布于:2008-07-11 00:27
如果在ESRI的Toolbar控件上添加一个Combobox 需要在Command类中实现IToolControl接口<BR>在将指定控件的句柄做为 IToolControl.hwnd 返回即可 <BR>过程描述 <BR>public class MyCombobox:BaseCommand,IToolControl<BR>{<BR>private int _handle=0;<BR>private ICompletionNotify _CompNotify; <BR>public MyCombobox(int handle)<BR>{<BR>_handle = handle;<BR>}
<P><FONT face=Verdana>public override void OnCreate(object hook)<BR>{<BR>// TOD 添加 SymbolType.OnCreate 实现</FONT></P>
<P><FONT face=Verdana>}<BR>#region IToolControl 成员</FONT></P>
<P><FONT face=Verdana>public int hWnd<BR>{<BR>get<BR>{<BR>// TOD 添加 SymbolType.hWnd getter 实现<BR>return _handle;<BR>}<BR>}</FONT></P>
<P><FONT face=Verdana>public void OnFocus(ICompletionNotify complete)<BR>{<BR>_CompNotify = complete;<BR>// TOD 添加 SymbolType.OnFocus 实现<BR>}</FONT></P>
<P><FONT face=Verdana>public bool OnDrop(ESRI.ArcGIS.SystemUI.esriCmdBarType barType)<BR>{<BR>// TOD 添加 SymbolType.OnDrop 实现<BR>if (barType == esriCmdBarType.esriCmdBarTypeToolbar )<BR>{<BR>return true;<BR>}<BR>else return false;<BR>}</FONT></P>
<P><FONT face=Verdana>#endregion<BR>} <BR></FONT></P>
喜欢0 评分0
没钱又丑,农村户口。头可断,发型一定不能乱。 邮箱:gisempire@qq.com
游客

返回顶部