private void barButtonItem12_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ICommand pCommand = new ControlsMapMeasureToolClass(); ITool pTool = pCommand as ITool; switch (this.xtraTabControl1.SelectedTabPageIndex) { case 0: pCommand.OnCreate(this.mainMapControl.Object); this.mainMapControl.CurrentTool = pTool; break; case 1: pCommand.OnCreate(this.axPageLayoutControl.Object); this.axPageLayoutControl.CurrentTool = pTool; break; } }
private void bubbleBtnMeasure_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e) { ICommand pCommand = new ControlsMapMeasureToolClass(); ITool pTool = pCommand as ITool; switch (this.tabControl.SelectedTabIndex) { case 0: pCommand.OnCreate(this.mainMapControl.Object); this.mainMapControl.CurrentTool = pTool; break; case 1: pCommand.OnCreate(this.axPageLayoutControl.Object); this.axPageLayoutControl.CurrentTool = pTool; break; } }