-
Notifications
You must be signed in to change notification settings - Fork 0
/
FloatForm.cs
64 lines (56 loc) · 1.61 KB
/
FloatForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Rings
{
public partial class FloatForm : Form
{
private bool isMouseDown = false;
private Point mousePosition;
public FloatForm()
{
InitializeComponent();
}
private void dragAndDropBox1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.isMouseDown = true;
this.mousePosition = e.Location;
this.Opacity = 0.7;
}
}
private void dragAndDropBox1_MouseMove(object sender, MouseEventArgs e)
{
if (isMouseDown)
{
Point windowPosition = Control.MousePosition;
windowPosition.Offset(-mousePosition.X, -mousePosition.Y);
this.Location = windowPosition;
}
}
private void dragAndDropBox1_MouseUp(object sender, MouseEventArgs e)
{
if (isMouseDown)
{
this.isMouseDown = false;
this.Opacity = 1;
}
}
private void FloatForm_Load(object sender, EventArgs e)
{
this.Left = 1200;
this.Top = 20;
this.dragAndDropBox1.onFileDrop += (file,shiftDown) =>
{
ClassifyForm classifyForm = new ClassifyForm(file, "");
classifyForm.Show();
};
}
}
}