PIbd-23_Nasyrov_A_G-Lab1 #1
@ -3,12 +3,12 @@
|
||||
partial class FormAirplaneWithRadar
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
@ -23,15 +23,15 @@
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
pictureBoxAirplaneWithRadar = new PictureBox();
|
||||
buttonCreate = new Button();
|
||||
buttonDown = new Button();
|
||||
buttonRight = new Button();
|
||||
buttonDown = new Button();
|
||||
buttonLeft = new Button();
|
||||
buttonUp = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)pictureBoxAirplaneWithRadar).BeginInit();
|
||||
@ -42,15 +42,15 @@
|
||||
pictureBoxAirplaneWithRadar.Dock = DockStyle.Fill;
|
||||
pictureBoxAirplaneWithRadar.Location = new Point(0, 0);
|
||||
pictureBoxAirplaneWithRadar.Name = "pictureBoxAirplaneWithRadar";
|
||||
pictureBoxAirplaneWithRadar.Size = new Size(882, 453);
|
||||
pictureBoxAirplaneWithRadar.Size = new Size(887, 454);
|
||||
pictureBoxAirplaneWithRadar.SizeMode = PictureBoxSizeMode.AutoSize;
|
||||
pictureBoxAirplaneWithRadar.TabIndex = 0;
|
||||
pictureBoxAirplaneWithRadar.TabStop = false;
|
||||
pictureBoxAirplaneWithRadar.Click += buttonMove_Click;
|
||||
//
|
||||
// buttonCreate
|
||||
//
|
||||
buttonCreate.Location = new Point(12, 412);
|
||||
buttonCreate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
buttonCreate.Location = new Point(12, 413);
|
||||
buttonCreate.Name = "buttonCreate";
|
||||
buttonCreate.Size = new Size(94, 29);
|
||||
buttonCreate.TabIndex = 1;
|
||||
@ -58,31 +58,34 @@
|
||||
buttonCreate.UseVisualStyleBackColor = true;
|
||||
buttonCreate.Click += buttonCreate_Click;
|
||||
//
|
||||
// buttonDown
|
||||
//
|
||||
buttonDown.Location = new Point(766, 396);
|
||||
buttonDown.Name = "buttonDown";
|
||||
buttonDown.Size = new Size(49, 45);
|
||||
buttonDown.TabIndex = 2;
|
||||
buttonDown.Text = "↓";
|
||||
buttonDown.UseVisualStyleBackColor = true;
|
||||
buttonDown.Click += buttonMove_Click;
|
||||
//
|
||||
// buttonRight
|
||||
//
|
||||
buttonRight.Location = new Point(821, 396);
|
||||
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
buttonRight.Location = new Point(825, 402);
|
||||
buttonRight.Name = "buttonRight";
|
||||
buttonRight.Size = new Size(49, 45);
|
||||
buttonRight.TabIndex = 3;
|
||||
buttonRight.Size = new Size(50, 40);
|
||||
buttonRight.TabIndex = 2;
|
||||
buttonRight.Text = "→";
|
||||
buttonRight.UseVisualStyleBackColor = true;
|
||||
buttonRight.Click += buttonMove_Click;
|
||||
//
|
||||
// buttonDown
|
||||
//
|
||||
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
buttonDown.Location = new Point(769, 402);
|
||||
buttonDown.Name = "buttonDown";
|
||||
buttonDown.Size = new Size(50, 40);
|
||||
buttonDown.TabIndex = 3;
|
||||
buttonDown.Text = "↓";
|
||||
buttonDown.UseVisualStyleBackColor = true;
|
||||
buttonDown.Click += buttonMove_Click;
|
||||
//
|
||||
// buttonLeft
|
||||
//
|
||||
buttonLeft.Location = new Point(711, 396);
|
||||
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
buttonLeft.Location = new Point(713, 402);
|
||||
buttonLeft.Name = "buttonLeft";
|
||||
buttonLeft.Size = new Size(49, 45);
|
||||
buttonLeft.Size = new Size(50, 40);
|
||||
buttonLeft.TabIndex = 4;
|
||||
buttonLeft.Text = "←";
|
||||
buttonLeft.UseVisualStyleBackColor = true;
|
||||
@ -90,9 +93,10 @@
|
||||
//
|
||||
// buttonUp
|
||||
//
|
||||
buttonUp.Location = new Point(766, 345);
|
||||
buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
buttonUp.Location = new Point(769, 356);
|
||||
buttonUp.Name = "buttonUp";
|
||||
buttonUp.Size = new Size(49, 45);
|
||||
buttonUp.Size = new Size(50, 40);
|
||||
buttonUp.TabIndex = 5;
|
||||
buttonUp.Text = "↑";
|
||||
buttonUp.UseVisualStyleBackColor = true;
|
||||
@ -102,11 +106,11 @@
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(882, 453);
|
||||
ClientSize = new Size(887, 454);
|
||||
Controls.Add(buttonUp);
|
||||
Controls.Add(buttonLeft);
|
||||
Controls.Add(buttonRight);
|
||||
Controls.Add(buttonDown);
|
||||
Controls.Add(buttonRight);
|
||||
Controls.Add(buttonCreate);
|
||||
Controls.Add(pictureBoxAirplaneWithRadar);
|
||||
Name = "FormAirplaneWithRadar";
|
||||
@ -120,8 +124,8 @@
|
||||
|
||||
private PictureBox pictureBoxAirplaneWithRadar;
|
||||
private Button buttonCreate;
|
||||
private Button buttonDown;
|
||||
private Button buttonRight;
|
||||
private Button buttonDown;
|
||||
private Button buttonLeft;
|
||||
private Button buttonUp;
|
||||
}
|
||||
|
@ -1,13 +1,3 @@
|
||||
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 ProjectAirplaneWithRadar
|
||||
{
|
||||
public partial class FormAirplaneWithRadar : Form
|
||||
@ -28,23 +18,6 @@ namespace ProjectAirplaneWithRadar
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void buttonCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
Random random = new Random();
|
||||
_drawningAirplaneWithRadar = new DrawningAirplaneWithRadar();
|
||||
if (_drawningAirplaneWithRadar.Init
|
||||
(random.Next(100, 300), // speed
|
||||
random.Next(1000, 3000),// weight
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),// bodycolor
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), //additionalColor
|
||||
Convert.ToBoolean(random.Next(0, 2)), // radar
|
||||
Convert.ToBoolean(random.Next(0, 2)), //dopbak
|
||||
pictureBoxAirplaneWithRadar.Width, pictureBoxAirplaneWithRadar.Height))
|
||||
{
|
||||
_drawningAirplaneWithRadar.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
||||
Draw();
|
||||
}
|
||||
}
|
||||
private void buttonMove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_drawningAirplaneWithRadar == null)
|
||||
@ -69,5 +42,22 @@ namespace ProjectAirplaneWithRadar
|
||||
}
|
||||
Draw();
|
||||
}
|
||||
private void buttonCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
Random random = new Random();
|
||||
_drawningAirplaneWithRadar = new DrawningAirplaneWithRadar();
|
||||
if (_drawningAirplaneWithRadar.Init
|
||||
(random.Next(100, 300), // speed
|
||||
random.Next(1000, 3000),// weight
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),// bodycolor
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), //additionalColor
|
||||
Convert.ToBoolean(random.Next(0, 2)), // radar
|
||||
Convert.ToBoolean(random.Next(0, 2)), //dopbak
|
||||
pictureBoxAirplaneWithRadar.Width, pictureBoxAirplaneWithRadar.Height))
|
||||
{
|
||||
_drawningAirplaneWithRadar.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
||||
Draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectAirplaneWithRadar
|
||||
{
|
||||
internal static class Program
|
||||
@ -14,7 +8,8 @@ namespace ProjectAirplaneWithRadar
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new FormAirplaneWithRadar());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user