AIParkingApplication/AIParkingApplication/Sidebar.cs

34 lines
1.2 KiB
C#

using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
namespace AIParkingApplication
{
public partial class Sidebar : UserControl
{
private Statistic statistic;
public Sidebar(ApiController apiController, string logoImagePath = @"C:\Users\B.I\Desktop\photo_2020-06-25_21-22-56.jpg")
{
InitializeComponent();
if (File.Exists(logoImagePath))
{
PictureBox pictureBoxImageLogo;
pictureBoxImageLogo = new PictureBox();
pictureBoxImageLogo.Location = new Point(1, 1);
pictureBoxImageLogo.BorderStyle = BorderStyle.FixedSingle;
pictureBoxImageLogo.Size = new Size(185, 185);
pictureBoxImageLogo.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBoxImageLogo.Image = new Bitmap(logoImagePath);
Controls.Add(pictureBoxImageLogo);
}
statistic = new Statistic(apiController, TimeSpan.FromMinutes(10));
statistic.Location = new Point(0, 400);
statistic.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
Controls.Add(statistic);
}
}
}