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 KursovayaDvornikovAM
{
    public partial class Maps : Form
    {
        public Maps()
        {
            InitializeComponent();
        }

        private void Maps_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string address = "YUkYdAJlTUEOQFtpfX5xcHhgYA==/?ll=50.256555%2C53.200911&z=17.2"; // адрес для отображения на карте
            string url = $"https://yandex.ru/maps/51/samara/house/upravlencheskiy_tupik_7/{address}";

            System.Diagnostics.Process.Start(url);
        }

        private void ReturnButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            MainForm mainForm = new MainForm();
            mainForm.Show();
        }

        private void HideButton_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
        }

        private void CloseButton_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void CloseButton_MouseEnter(object sender, EventArgs e)
        {
            CloseButton.ForeColor = Color.Red;
        }

        private void CloseButton_MouseLeave(object sender, EventArgs e)
        {
            CloseButton.ForeColor = Color.Black;
        }

        private void HideButton_MouseEnter(object sender, EventArgs e)
        {
            HideButton.ForeColor = Color.Red;
        }

        private void HideButton_MouseLeave(object sender, EventArgs e)
        {
            HideButton.ForeColor = Color.Black;
        }
        Point lastPoint;

        private void Maps_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.Left += e.X - lastPoint.X;
                this.Top += e.Y - lastPoint.Y;

            }
        }

        private void Maps_MouseDown(object sender, MouseEventArgs e)
        {
            lastPoint = new Point(e.X, e.Y);
        }
    }
}
