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 WindowsFormsApp3
{
public partial class Form1: Form
{
int kvadrant = 0;
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
private void label2_Click(object sender, EventArgs e)
{
}
private void btn_vhd_MouseMove(object sender, MouseEventArgs e)
{
int h = ClientRectangle.Height;
int w = ClientRectangle.Width;
int x = e.X;
int y = e.Y;
if (x < w/2 && y < h/2)
kvadrant = 1;
else if (x > w / 2 && y < h / 2)
kvadrant = 2;
else if (x < w / 2 && y > h / 2)
kvadrant = 3;
else
kvadrant = 4;
if (kvadrant == 1)
btn_vhd.Location = new Point(w - 50, h - 30);
else if (kvadrant == 2)//send to 3
btn_vhd.Location = new Point(50, h - 30);
else if (kvadrant == 3)//send to 2
btn_vhd.Location = new Point(w -50, 30);
else
btn_vhd.Location = new Point(50, 30);
Console.WriteLine($"{e.X}, {e.Y} , {e.Location}");
}
}
}