Правки на занятии
This commit is contained in:
parent
12990f7e9e
commit
9dc49158cc
2
Locomative/Locomative/LocomativeForm.Designer.cs
generated
2
Locomative/Locomative/LocomativeForm.Designer.cs
generated
@ -73,6 +73,8 @@
|
||||
this.pictureBoxLocomative.Size = new System.Drawing.Size(800, 428);
|
||||
this.pictureBoxLocomative.TabIndex = 2;
|
||||
this.pictureBoxLocomative.TabStop = false;
|
||||
this.pictureBoxLocomative.Click += new System.EventHandler(this.pictureBoxLocomative_Click);
|
||||
this.pictureBoxLocomative.Resize += new System.EventHandler(this.PictureBoxResize);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
|
@ -23,8 +23,8 @@ namespace Locomative
|
||||
{
|
||||
Random rnd = new();
|
||||
_loco = new DrawningLocomative();
|
||||
_loco.Init(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
|
||||
_loco.SetPosition(rnd.Next(10, 300), rnd.Next(10, 400), pictureBoxLocomative.Width, pictureBoxLocomative.Height);
|
||||
_loco.Init(rnd.Next(1, 200), rnd.Next(10, 300), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
|
||||
_loco.SetPosition(rnd.Next(10, 300), rnd.Next(10, 300), pictureBoxLocomative.Width, pictureBoxLocomative.Height);
|
||||
toolStripStatusLabelColor.Text = $"Öâåò:{_loco.Locomative?.BodyColor.Name}";
|
||||
toolStripStatusLabelSpeed.Text = $"Ñêîðîñòü:{_loco.Locomative?.Speed}";
|
||||
toolStripStatusLabelWeight.Text = $"Âåñ:{_loco.Locomative?.Weight}";
|
||||
@ -56,5 +56,16 @@ namespace Locomative
|
||||
}
|
||||
Draw();
|
||||
}
|
||||
|
||||
private void pictureBoxLocomative_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void PictureBoxResize(object sender, EventArgs e)
|
||||
{
|
||||
_loco?.ChangeBorders(pictureBoxLocomative.Width, pictureBoxLocomative.Height);
|
||||
Draw();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user