|
阅读:993回复:0
在ArcGisEngine 开发中如何在Toolbar控件上添加Combobox等其他控件
如果在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> |
|
|