toolBar按钮事件

2015-06-10 11:27:15  访问(1269) 赞(0) 踩(0)


		// This method handles the toolbar's button click event (for all buttons on the bar).
		private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
		{
			if (object.ReferenceEquals(e.Button, toolBarButtonFileOpen))
				DisplayOpenFileDialog();
			else if (object.ReferenceEquals(e.Button, toolBarButtonLayerControl))
				DisplayLayerControlDialog();
			else 
			{
				// MapTool name stored in button tag.
				mapControl1.Tools.LeftButtonTool = (string) e.Button.Tag;
				
				// Choice of tool may have been canceled in code, so now
				//  set the toolbar to match the current LeftButton tool
				CheckToolButton(mapControl1.Tools.LeftButtonTool);
			}
		}


标签:toolBar按钮事件 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)