aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjtsshieh <[email protected]>2017-07-31 21:47:01 -0400
committerjtsshieh <[email protected]>2017-07-31 21:47:01 -0400
commit312cd741458d2cb3a9274b671ce7b55bcd680849 (patch)
tree6b9906d7443f6a93d8a44f0048a4ac8ee4b1145d
parent2c87be280cb1869331549e5c6160b017fabea43e (diff)
downloadhistacom2-312cd741458d2cb3a9274b671ce7b55bcd680849.tar.gz
histacom2-312cd741458d2cb3a9274b671ce7b55bcd680849.tar.bz2
histacom2-312cd741458d2cb3a9274b671ce7b55bcd680849.zip
WIndow Resize
Pulled Straight out of one of my old vb oses :laughing:
-rw-r--r--TimeHACK.Engine/Template/WinClassic.Designer.cs3
-rw-r--r--TimeHACK.Engine/Template/WinClassic.cs24
2 files changed, 27 insertions, 0 deletions
diff --git a/TimeHACK.Engine/Template/WinClassic.Designer.cs b/TimeHACK.Engine/Template/WinClassic.Designer.cs
index 8f7540c..7801b96 100644
--- a/TimeHACK.Engine/Template/WinClassic.Designer.cs
+++ b/TimeHACK.Engine/Template/WinClassic.Designer.cs
@@ -200,6 +200,7 @@
this.left.Size = new System.Drawing.Size(4, 292);
this.left.TabIndex = 3;
this.left.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown);
+ this.left.MouseMove += new System.Windows.Forms.MouseEventHandler(this.left_MouseMove);
//
// bottom
//
@@ -212,6 +213,7 @@
this.bottom.Size = new System.Drawing.Size(296, 4);
this.bottom.TabIndex = 5;
this.bottom.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown);
+ this.bottom.MouseMove += new System.Windows.Forms.MouseEventHandler(this.bottom_MouseMove);
//
// right
//
@@ -223,6 +225,7 @@
this.right.Size = new System.Drawing.Size(4, 296);
this.right.TabIndex = 7;
this.right.MouseDown += new System.Windows.Forms.MouseEventHandler(this.border_MouseDown);
+ this.right.MouseMove += new System.Windows.Forms.MouseEventHandler(this.right_MouseMove);
//
// top
//
diff --git a/TimeHACK.Engine/Template/WinClassic.cs b/TimeHACK.Engine/Template/WinClassic.cs
index 3f69115..ca55c59 100644
--- a/TimeHACK.Engine/Template/WinClassic.cs
+++ b/TimeHACK.Engine/Template/WinClassic.cs
@@ -66,6 +66,30 @@ namespace TimeHACK.Engine.Template
Title.ForeColor = SaveSystem.currentTheme.inactiveTitleTextColor;
}
+ private void right_MouseMove(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Left)
+ {
+ this.Size = new Size(MousePosition.X - this.Location.X, this.Size.Height);
+ }
+ }
+
+ private void left_MouseMove(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Left)
+ {
+ this.Size = new Size(this.Size.Width + (this.Location.X - MousePosition.X), this.Size.Height);
+ this.Location = new Point(MousePosition.X, this.Location.Y);
+ }
+ }
+
+ private void bottom_MouseMove(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Left) {
+ this.Size = new Size(this.Size.Width, MousePosition.Y - this.Location.Y);
+ }
+ }
+
public bool max = false;
private void maximizebutton_Click(object sender, EventArgs e)