private void Form2_MouseUp(object sender, MouseEventArgs e) { this.selectedTool = ((Form1)this.MdiParent).selectedTool; switch (this.selectedTool) { case Tool.TOOL.PENCIL: case Tool.TOOL.BRUSH: Pencil_Up(); isRecord = false; break; case Tool.TOOL.LINE: case Tool.TOOL.SQUARE: case Tool.TOOL.OVAL: Shape_Up(); break; case Tool.TOOL.WIDTH: break; case Tool.TOOL.FILL: break; } drawAllUp(); this.panel1.Update(); }
private void Form2_MouseMove(object sender, MouseEventArgs e) { if (!isRecord) { return; } this.selectedTool = ((Form1)this.MdiParent).selectedTool; switch (this.selectedTool) { case Tool.TOOL.PENCIL: case Tool.TOOL.BRUSH: Pencil_Move(); break; case Tool.TOOL.LINE: case Tool.TOOL.SQUARE: case Tool.TOOL.OVAL: Shape_Move(); break; case Tool.TOOL.WIDTH: break; case Tool.TOOL.FILL: break; } this.panel1.Update(); }
private void Form2_MouseDown(object sender, MouseEventArgs e) { this.selectedTool = ((Form1)this.MdiParent).selectedTool; isRecord = true; switch (this.selectedTool) { case Tool.TOOL.PENCIL: case Tool.TOOL.BRUSH: Pencil_Start(); break; case Tool.TOOL.LINE: case Tool.TOOL.SQUARE: case Tool.TOOL.OVAL: Shape_Start(); break; case Tool.TOOL.WIDTH: break; case Tool.TOOL.FILL: break; } }
public Form1() { InitializeComponent(); this.toolStrip_colordialog.BackColor = Color.Black; this.selectedTool = Tool.TOOL.EMPTY; }
private void toolStrip_oval_Click(object sender, EventArgs e) { this.selectedTool = Tool.TOOL.OVAL; }
private void toolStrip_square_Click(object sender, EventArgs e) { this.selectedTool = Tool.TOOL.SQUARE; }
private void toolStrip_line_Click(object sender, EventArgs e) { this.selectedTool = Tool.TOOL.LINE; }
private void toolStrip_brush_Click(object sender, EventArgs e) { this.selectedTool = Tool.TOOL.BRUSH; }
private void toolStrip_pencil_Click(object sender, EventArgs e) { this.selectedTool = Tool.TOOL.PENCIL; }