using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace M04 { public partial class Animace : Form { public Animace() { InitializeComponent(); } // Provede krok private void button1_Click(object sender, EventArgs e) { (this.Owner as Form1).PerformStep((this.Owner as Form1).net); (this.Owner as Form1).CheckFinishing(); } // Vrátí PictureBox do hlavního formuláře private void Animace_FormClosing(object sender, FormClosingEventArgs e) { (this.Owner as Form1).pictureBox1.Parent = this.Owner; (this.Owner as Form1).pictureBox1.Location = new Point(12,131); (this.Owner as Form1).pictureBox1.Size = new Size(924,589); } private void button2_Click(object sender, EventArgs e) { this.Close(); } // Zoom private void Animace_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '+') { (this.Owner as Form1).zoom += 0.5f; } if (e.KeyChar == '-') { (this.Owner as Form1).zoom -= 0.5f; } (this.Owner as Form1).pictureBox1.Invalidate(); (this.Owner as Form1).pictureBox1.Update(); } } }