Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace tanks
- {
- public partial class FormMain : Form
- {
- int firstReminder = 0;
- int secondReminder = 0;
- public FormMain()
- {
- InitializeComponent();
- }
- private void btnright_Click(object sender, EventArgs e)
- {
- pictureBox1.Image = Properties.Resources.Right;
- pictureBox1.Left += 10;
- if (pictureBox1.Left >= 650 - 100)
- {
- pictureBox1.Left = 650 - 100;
- }
- }
- private void btnLEFT_Click(object sender, EventArgs e)
- {
- pictureBox1.Image = Properties.Resources.Left;
- pictureBox1.Left -= 10;
- if (pictureBox1.Left <= 0)
- {
- pictureBox1.Left = 0;
- }
- }
- private void btnUP_Click(object sender, EventArgs e)
- {
- pictureBox1.Image = Properties.Resources.Up;
- pictureBox1.Top -= 10;
- if (pictureBox1.Top <= 0)
- {
- pictureBox1.Top = 0;
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- pictureBox1.Width += 10;
- pictureBox1.Height += 10;
- pictureBox1.Top -= 5;
- pictureBox1.Left -= 5;
- if (pictureBox1.Width >= 200 && pictureBox1.Height >= 200)
- {
- pictureBox1.Width = 200;
- pictureBox1.Height = 200;
- if (firstReminder++ > 0)
- {
- pictureBox1.Top = pictureBox1.Top + 5;
- pictureBox1.Left = pictureBox1.Left + 5;
- }
- }
- }
- private void FormMain_Load(object sender, EventArgs e)
- {
- }
- private void button2_Click(object sender, EventArgs e)
- {
- pictureBox1.Width -= 10;
- pictureBox1.Height -= 10;
- pictureBox1.Top += 5;
- pictureBox1.Left += 5;
- if (pictureBox1.Width <= 20 && pictureBox1.Height <= 20)
- {
- pictureBox1.Width = 20;
- pictureBox1.Height = 20;
- if (secondReminder++ > 0)
- {
- pictureBox1.Top = pictureBox1.Top - 5;
- pictureBox1.Left = pictureBox1.Left - 5;
- }
- }
- }
- private void btnDOWN_Click_1(object sender, EventArgs e)
- {
- pictureBox1.Image = Properties.Resources.Down;
- pictureBox1.Top += 10;
- if (pictureBox1.Top >= 317 - 115)
- {
- pictureBox1.Top = 317 - 115;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement