-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathFormMarquee.cs
57 lines (46 loc) · 1.59 KB
/
FormMarquee.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
using System;
using System.Drawing;
using System.Web.SessionState;
using System.Windows.Forms;
namespace WinForm_Ollama_Copilot
{
public partial class FormMarquee : Form
{
public const int TITLE_PADDING = 35;
public Form1 _mParent = null;
public static bool _sIsOpen = false;
public FormMarquee()
{
InitializeComponent();
}
private void FormMarquee_Load(object sender, EventArgs e)
{
this.BackColor = this.TransparencyKey = Color.Red;
_sIsOpen = true;
}
public void SetupInputEvents()
{
this.LocationChanged += new System.EventHandler(this.FormMarquee_LocationChanged);
this.Resize += new System.EventHandler(this.FormMarquee_Resize);
}
private void FormMarquee_LocationChanged(object sender, EventArgs e)
{
_mParent.TxtX.Text = this.Location.X.ToString();
Form1.UpdateConfiguration("OCR.X", _mParent.TxtX.Text);
int y = this.Location.Y;
y += TITLE_PADDING;
_mParent.TxtY.Text = y.ToString();
Form1.UpdateConfiguration("OCR.Y", _mParent.TxtY.Text);
}
private void FormMarquee_Resize(object sender, EventArgs e)
{
_mParent.TxtWidth.Text = this.Width.ToString();
int height = this.Height - TITLE_PADDING;
_mParent.TxtHeight.Text = height.ToString();
}
private void FormMarquee_FormClosed(object sender, FormClosedEventArgs e)
{
_sIsOpen = false;
}
}
}