public MainForm() { InitializeComponent(); ICommandPoolEdit pool = this.m_cpool as ICommandPoolEdit; pool.SetHook(this.axMapControl1.Object); }
private void buttonItem9_Click(object sender, EventArgs e) { UID uID = new UIDClass(); uID.Value = "esriControls.ControlsAddDataCommand"; ICommand cmd = this.m_cpool.FindByUID(uID); if (cmd == null) { cmd = new ControlsAddDataCommandClass(); ICommandPoolEdit pool = this.m_cpool as ICommandPoolEdit; pool.AddCommand(cmd, uID); pool.CallOnCreate(cmd); } cmd.OnClick(); }
private void buttonItem5_Click(object sender, EventArgs e) { UID uID = new UIDClass(); uID.Value = "esriControls.ControlsMapZoomInTool"; ICommand cmd = this.m_cpool.FindByUID(uID); if (cmd == null) { cmd = new ControlsMapZoomInToolClass(); ICommandPoolEdit pool = this.m_cpool as ICommandPoolEdit; pool.AddCommand(cmd, uID); pool.CallOnCreate(cmd); } ITool tool = cmd as ITool; this.axMapControl1.CurrentTool = tool; }