Первая лабораторная работа доработка

This commit is contained in:
Kamil Haliullov 2022-12-23 08:23:07 +04:00
parent d36a14075d
commit 1535b54038
3 changed files with 35 additions and 21 deletions

View File

@ -130,7 +130,7 @@ namespace AntiAircraftGun
g.DrawEllipse(pen, _startPosX + 70, _startPosY + 20, 20, 20); g.DrawEllipse(pen, _startPosX + 70, _startPosY + 20, 20, 20);
//катки в гусеницах //катки в гусеницах
Brush brBlack = new SolidBrush(Color.Black); Brush brBlack = new SolidBrush(Color.Black);
g.FillEllipse(brBlack, _startPosX + 1, _startPosY + 21, 18, 18); g.FillEllipse(brBlack, _startPosX +1, _startPosY + 21, 18, 18);
g.FillEllipse(brBlack, _startPosX + 71, _startPosY + 21, 18, 18); g.FillEllipse(brBlack, _startPosX + 71, _startPosY + 21, 18, 18);
g.FillEllipse(brBlack, _startPosX + 19, _startPosY + 30, 11, 11); g.FillEllipse(brBlack, _startPosX + 19, _startPosY + 30, 11, 11);
g.FillEllipse(brBlack, _startPosX + 58, _startPosY + 30, 11, 11); g.FillEllipse(brBlack, _startPosX + 58, _startPosY + 30, 11, 11);

View File

@ -46,11 +46,13 @@
// //
this.pictureBoxAntiAircraftGun.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBoxAntiAircraftGun.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBoxAntiAircraftGun.Location = new System.Drawing.Point(0, 0); this.pictureBoxAntiAircraftGun.Location = new System.Drawing.Point(0, 0);
this.pictureBoxAntiAircraftGun.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pictureBoxAntiAircraftGun.Name = "pictureBoxAntiAircraftGun"; this.pictureBoxAntiAircraftGun.Name = "pictureBoxAntiAircraftGun";
this.pictureBoxAntiAircraftGun.Size = new System.Drawing.Size(800, 425); this.pictureBoxAntiAircraftGun.Size = new System.Drawing.Size(700, 316);
this.pictureBoxAntiAircraftGun.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBoxAntiAircraftGun.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBoxAntiAircraftGun.TabIndex = 0; this.pictureBoxAntiAircraftGun.TabIndex = 0;
this.pictureBoxAntiAircraftGun.TabStop = false; this.pictureBoxAntiAircraftGun.TabStop = false;
this.pictureBoxAntiAircraftGun.Click += new System.EventHandler(this.pictureBoxAntiAircraftGun_Click);
this.pictureBoxAntiAircraftGun.Resize += new System.EventHandler(this.PictureBoxAntiAircraftGun_Resize); this.pictureBoxAntiAircraftGun.Resize += new System.EventHandler(this.PictureBoxAntiAircraftGun_Resize);
// //
// statusStrip // statusStrip
@ -60,35 +62,37 @@
this.toolStripStatusLabelSpeed, this.toolStripStatusLabelSpeed,
this.toolStripStatusLabelWeight, this.toolStripStatusLabelWeight,
this.toolStripStatusLabelBodyColor}); this.toolStripStatusLabelBodyColor});
this.statusStrip.Location = new System.Drawing.Point(0, 425); this.statusStrip.Location = new System.Drawing.Point(0, 316);
this.statusStrip.Name = "statusStrip"; this.statusStrip.Name = "statusStrip";
this.statusStrip.Size = new System.Drawing.Size(800, 26); this.statusStrip.Padding = new System.Windows.Forms.Padding(1, 0, 12, 0);
this.statusStrip.Size = new System.Drawing.Size(700, 22);
this.statusStrip.TabIndex = 1; this.statusStrip.TabIndex = 1;
// //
// toolStripStatusLabelSpeed // toolStripStatusLabelSpeed
// //
this.toolStripStatusLabelSpeed.Name = "toolStripStatusLabelSpeed"; this.toolStripStatusLabelSpeed.Name = "toolStripStatusLabelSpeed";
this.toolStripStatusLabelSpeed.Size = new System.Drawing.Size(73, 20); this.toolStripStatusLabelSpeed.Size = new System.Drawing.Size(59, 17);
this.toolStripStatusLabelSpeed.Text = "Скорость"; this.toolStripStatusLabelSpeed.Text = "Скорость";
// //
// toolStripStatusLabelWeight // toolStripStatusLabelWeight
// //
this.toolStripStatusLabelWeight.Name = "toolStripStatusLabelWeight"; this.toolStripStatusLabelWeight.Name = "toolStripStatusLabelWeight";
this.toolStripStatusLabelWeight.Size = new System.Drawing.Size(33, 20); this.toolStripStatusLabelWeight.Size = new System.Drawing.Size(26, 17);
this.toolStripStatusLabelWeight.Text = "Вес"; this.toolStripStatusLabelWeight.Text = "Вес";
// //
// toolStripStatusLabelBodyColor // toolStripStatusLabelBodyColor
// //
this.toolStripStatusLabelBodyColor.Name = "toolStripStatusLabelBodyColor"; this.toolStripStatusLabelBodyColor.Name = "toolStripStatusLabelBodyColor";
this.toolStripStatusLabelBodyColor.Size = new System.Drawing.Size(42, 20); this.toolStripStatusLabelBodyColor.Size = new System.Drawing.Size(33, 17);
this.toolStripStatusLabelBodyColor.Text = "Цвет"; this.toolStripStatusLabelBodyColor.Text = "Цвет";
// //
// buttonCreate // buttonCreate
// //
this.buttonCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonCreate.Location = new System.Drawing.Point(11, 381); this.buttonCreate.Location = new System.Drawing.Point(10, 286);
this.buttonCreate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonCreate.Name = "buttonCreate"; this.buttonCreate.Name = "buttonCreate";
this.buttonCreate.Size = new System.Drawing.Size(94, 29); this.buttonCreate.Size = new System.Drawing.Size(82, 22);
this.buttonCreate.TabIndex = 2; this.buttonCreate.TabIndex = 2;
this.buttonCreate.Text = "Создать"; this.buttonCreate.Text = "Создать";
this.buttonCreate.UseVisualStyleBackColor = true; this.buttonCreate.UseVisualStyleBackColor = true;
@ -99,9 +103,10 @@
this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonUp.BackgroundImage = global::AntiAircraftGun.Properties.Resources.arrowUp; this.buttonUp.BackgroundImage = global::AntiAircraftGun.Properties.Resources.arrowUp;
this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.buttonUp.Location = new System.Drawing.Point(725, 341); this.buttonUp.Location = new System.Drawing.Point(634, 256);
this.buttonUp.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonUp.Name = "buttonUp"; this.buttonUp.Name = "buttonUp";
this.buttonUp.Size = new System.Drawing.Size(30, 29); this.buttonUp.Size = new System.Drawing.Size(26, 26);
this.buttonUp.TabIndex = 3; this.buttonUp.TabIndex = 3;
this.buttonUp.UseVisualStyleBackColor = true; this.buttonUp.UseVisualStyleBackColor = true;
this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click); this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click);
@ -111,9 +116,10 @@
this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonLeft.BackgroundImage = global::AntiAircraftGun.Properties.Resources.arrowLeft; this.buttonLeft.BackgroundImage = global::AntiAircraftGun.Properties.Resources.arrowLeft;
this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.buttonLeft.Location = new System.Drawing.Point(688, 379); this.buttonLeft.Location = new System.Drawing.Point(602, 284);
this.buttonLeft.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonLeft.Name = "buttonLeft"; this.buttonLeft.Name = "buttonLeft";
this.buttonLeft.Size = new System.Drawing.Size(30, 29); this.buttonLeft.Size = new System.Drawing.Size(26, 26);
this.buttonLeft.TabIndex = 4; this.buttonLeft.TabIndex = 4;
this.buttonLeft.UseVisualStyleBackColor = true; this.buttonLeft.UseVisualStyleBackColor = true;
this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click); this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click);
@ -123,9 +129,10 @@
this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonRight.BackgroundImage = global::AntiAircraftGun.Properties.Resources.arrowRight; this.buttonRight.BackgroundImage = global::AntiAircraftGun.Properties.Resources.arrowRight;
this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.buttonRight.Location = new System.Drawing.Point(760, 379); this.buttonRight.Location = new System.Drawing.Point(665, 284);
this.buttonRight.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonRight.Name = "buttonRight"; this.buttonRight.Name = "buttonRight";
this.buttonRight.Size = new System.Drawing.Size(30, 29); this.buttonRight.Size = new System.Drawing.Size(26, 26);
this.buttonRight.TabIndex = 5; this.buttonRight.TabIndex = 5;
this.buttonRight.UseVisualStyleBackColor = true; this.buttonRight.UseVisualStyleBackColor = true;
this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click); this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click);
@ -135,18 +142,19 @@
this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonDown.BackgroundImage = global::AntiAircraftGun.Properties.Resources.arrowDown; this.buttonDown.BackgroundImage = global::AntiAircraftGun.Properties.Resources.arrowDown;
this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.buttonDown.Location = new System.Drawing.Point(725, 379); this.buttonDown.Location = new System.Drawing.Point(634, 284);
this.buttonDown.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.buttonDown.Name = "buttonDown"; this.buttonDown.Name = "buttonDown";
this.buttonDown.Size = new System.Drawing.Size(30, 29); this.buttonDown.Size = new System.Drawing.Size(26, 26);
this.buttonDown.TabIndex = 6; this.buttonDown.TabIndex = 6;
this.buttonDown.UseVisualStyleBackColor = true; this.buttonDown.UseVisualStyleBackColor = true;
this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click); this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
// //
// FormAntiAircraftGun // FormAntiAircraftGun
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 451); this.ClientSize = new System.Drawing.Size(700, 338);
this.Controls.Add(this.buttonDown); this.Controls.Add(this.buttonDown);
this.Controls.Add(this.buttonRight); this.Controls.Add(this.buttonRight);
this.Controls.Add(this.buttonLeft); this.Controls.Add(this.buttonLeft);
@ -154,9 +162,10 @@
this.Controls.Add(this.buttonCreate); this.Controls.Add(this.buttonCreate);
this.Controls.Add(this.pictureBoxAntiAircraftGun); this.Controls.Add(this.pictureBoxAntiAircraftGun);
this.Controls.Add(this.statusStrip); this.Controls.Add(this.statusStrip);
this.MinimumSize = new System.Drawing.Size(50, 80); this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.MinimumSize = new System.Drawing.Size(46, 70);
this.Name = "FormAntiAircraftGun"; this.Name = "FormAntiAircraftGun";
this.Text = "Зенитное орудие"; this.Text = "Бронированная машина";
this.Click += new System.EventHandler(this.ButtonMove_Click); this.Click += new System.EventHandler(this.ButtonMove_Click);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxAntiAircraftGun)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAntiAircraftGun)).EndInit();
this.statusStrip.ResumeLayout(false); this.statusStrip.ResumeLayout(false);

View File

@ -78,5 +78,10 @@ namespace AntiAircraftGun
_antiAircrafGun?.ChangeBorders(pictureBoxAntiAircraftGun.Width, pictureBoxAntiAircraftGun.Height); _antiAircrafGun?.ChangeBorders(pictureBoxAntiAircraftGun.Width, pictureBoxAntiAircraftGun.Height);
Draw(); Draw();
} }
private void pictureBoxAntiAircraftGun_Click(object sender, EventArgs e)
{
}
} }
} }