private void toolsBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) { if (curTool != null) { curTool.UnloadTool(); } ToolBarButton curButton = e.Button; SetToolBarButtonsState(curButton); if (curButton == lineBtn) { curTool = new LineTool(toolArgs); } else if (curButton == rectangleBtn) { curTool = new RectangleTool(toolArgs); } else if (curButton == brushBtn) { curTool = new BrushTool(toolArgs, BrushToolType.FreeBrush); } else if (curButton == ellipseBtn) { curTool = new EllipseTool(toolArgs); } }
private void toolsBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) { curTool.UnloadTool(); ToolBarButton curButton = e.Button; SetToolBarButtonsState(curButton); if (curButton == arrowBtn) { curTool = new PointerTool(toolArgs); } if (curButton == lineBtn) { curTool = new LineTool(toolArgs); } else if (curButton == rectangleBtn) { curTool = new RectangleTool(toolArgs); } else if (curButton == pencilBtn) { curTool = new PencilTool(toolArgs); } else if (curButton == brushBtn) { curTool = new BrushTool(toolArgs, BrushToolType.FreeBrush); } else if (curButton == ellipseBtn) { curTool = new EllipseTool(toolArgs); } else if (curButton == textBtn) { curTool = new TextTool(toolArgs); } else if (curButton == fillBtn) { curTool = new FillTool(toolArgs); } else if (curButton == eraserBtn) { curTool = new BrushTool(toolArgs, BrushToolType.Eraser); } else if (curButton == transBtn) { Graphics _graphics = this.CreateGraphics(); Pen _pen = new Pen(Color.Black); _graphics.DrawEllipse(_pen, 200, 250, 100, 150); } }
private void toolsBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) { curTool.UnloadTool(); ToolBarButton curButton = e.Button; SetToolBarButtonsState(curButton); if (curButton == arrowBtn) { curTool = new PointerTool(toolArgs); } if (curButton == lineBtn) { curTool = new LineTool(toolArgs); } else if (curButton == rectangleBtn) { curTool = new RectangleTool(toolArgs); } else if (curButton == pencilBtn) { curTool = new PencilTool(toolArgs); } else if (curButton == brushBtn) { curTool = new BrushTool(toolArgs, BrushToolType.FreeBrush); } else if (curButton == ellipseBtn) { curTool = new EllipseTool(toolArgs); } else if (curButton == textBtn) { curTool = new TextTool(toolArgs); } else if (curButton == fillBtn) { curTool = new FillTool(toolArgs); } else if (curButton == eraserBtn) { curTool = new BrushTool(toolArgs, BrushToolType.Eraser); } }