Browse Source

适应小屏幕分辨率

章政 8 years ago
parent
commit
467821b919
2 changed files with 29 additions and 19 deletions
  1. 13 13
      UAS_KanBan/Process.Designer.cs
  2. 16 6
      UAS_KanBan/Process.cs

+ 13 - 13
UAS_KanBan/Process.Designer.cs

@@ -71,7 +71,7 @@
             this.TopLine.MouseBack = null;
             this.TopLine.Name = "TopLine";
             this.TopLine.NormlBack = null;
-            this.TopLine.Size = new System.Drawing.Size(1180, 2);
+            this.TopLine.Size = new System.Drawing.Size(1139, 2);
             this.TopLine.TabIndex = 0;
             // 
             // BottomLine
@@ -86,7 +86,7 @@
             this.BottomLine.MouseBack = null;
             this.BottomLine.Name = "BottomLine";
             this.BottomLine.NormlBack = null;
-            this.BottomLine.Size = new System.Drawing.Size(1180, 2);
+            this.BottomLine.Size = new System.Drawing.Size(1139, 2);
             this.BottomLine.TabIndex = 1;
             // 
             // Line1
@@ -112,7 +112,7 @@
             this.Line2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.Line2.ControlState = CCWin.SkinClass.ControlState.Normal;
             this.Line2.DownBack = null;
-            this.Line2.Location = new System.Drawing.Point(839, 23);
+            this.Line2.Location = new System.Drawing.Point(841, 23);
             this.Line2.MouseBack = null;
             this.Line2.Name = "Line2";
             this.Line2.NormlBack = null;
@@ -131,7 +131,7 @@
             this.MidLine.MouseBack = null;
             this.MidLine.Name = "MidLine";
             this.MidLine.NormlBack = null;
-            this.MidLine.Size = new System.Drawing.Size(341, 2);
+            this.MidLine.Size = new System.Drawing.Size(300, 2);
             this.MidLine.TabIndex = 2;
             // 
             // Title
@@ -155,7 +155,7 @@
             this.Line3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
             this.Line3.ControlState = CCWin.SkinClass.ControlState.Normal;
             this.Line3.DownBack = null;
-            this.Line3.Location = new System.Drawing.Point(949, 23);
+            this.Line3.Location = new System.Drawing.Point(952, 23);
             this.Line3.MouseBack = null;
             this.Line3.Name = "Line3";
             this.Line3.NormlBack = null;
@@ -253,7 +253,7 @@
             this.LineCode_label.BackColor = System.Drawing.Color.Transparent;
             this.LineCode_label.BorderColor = System.Drawing.Color.White;
             this.LineCode_label.Font = new System.Drawing.Font("宋体", 30F);
-            this.LineCode_label.Location = new System.Drawing.Point(847, 34);
+            this.LineCode_label.Location = new System.Drawing.Point(849, 33);
             this.LineCode_label.Name = "LineCode_label";
             this.LineCode_label.Size = new System.Drawing.Size(97, 40);
             this.LineCode_label.TabIndex = 14;
@@ -266,7 +266,7 @@
             this.WorkShift_label.BackColor = System.Drawing.Color.Transparent;
             this.WorkShift_label.BorderColor = System.Drawing.Color.White;
             this.WorkShift_label.Font = new System.Drawing.Font("宋体", 30F);
-            this.WorkShift_label.Location = new System.Drawing.Point(849, 90);
+            this.WorkShift_label.Location = new System.Drawing.Point(852, 90);
             this.WorkShift_label.Name = "WorkShift_label";
             this.WorkShift_label.Size = new System.Drawing.Size(97, 40);
             this.WorkShift_label.TabIndex = 15;
@@ -362,7 +362,7 @@
             this.班制.BorderSize = 0;
             this.班制.Font = new System.Drawing.Font("微软雅黑", 25F, System.Drawing.FontStyle.Bold);
             this.班制.ForeColor = System.Drawing.Color.Red;
-            this.班制.Location = new System.Drawing.Point(973, 88);
+            this.班制.Location = new System.Drawing.Point(966, 88);
             this.班制.Name = "班制";
             this.班制.Size = new System.Drawing.Size(0, 45);
             this.班制.TabIndex = 24;
@@ -376,7 +376,7 @@
             this.Line.BorderSize = 0;
             this.Line.Font = new System.Drawing.Font("微软雅黑", 25F, System.Drawing.FontStyle.Bold);
             this.Line.ForeColor = System.Drawing.Color.Red;
-            this.Line.Location = new System.Drawing.Point(973, 32);
+            this.Line.Location = new System.Drawing.Point(966, 32);
             this.Line.Name = "Line";
             this.Line.Size = new System.Drawing.Size(0, 45);
             this.Line.TabIndex = 23;
@@ -387,10 +387,10 @@
             this.Title2.AutoSize = true;
             this.Title2.BackColor = System.Drawing.Color.Transparent;
             this.Title2.BorderColor = System.Drawing.Color.White;
-            this.Title2.Font = new System.Drawing.Font("宋体", 50F);
-            this.Title2.Location = new System.Drawing.Point(344, 168);
+            this.Title2.Font = new System.Drawing.Font("宋体", 45F);
+            this.Title2.Location = new System.Drawing.Point(319, 159);
             this.Title2.Name = "Title2";
-            this.Title2.Size = new System.Drawing.Size(599, 67);
+            this.Title2.Size = new System.Drawing.Size(535, 60);
             this.Title2.TabIndex = 25;
             this.Title2.Text = "投入\\产出实时统计";
             // 
@@ -413,7 +413,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.Black;
-            this.ClientSize = new System.Drawing.Size(1184, 687);
+            this.ClientSize = new System.Drawing.Size(1143, 687);
             this.Controls.Add(this.Title2);
             this.Controls.Add(this.班制);
             this.Controls.Add(this.Line);

+ 16 - 6
UAS_KanBan/Process.cs

@@ -22,6 +22,15 @@ namespace UAS_KanBan
             InitializeComponent();
             Line.Text = LineCode;
             班制.Text = WcCode;
+            int WorkHeight = Screen.PrimaryScreen.Bounds.Width;
+            if (WorkHeight <= 1024)
+            {
+                for (int i = 0; i < this.Controls.Count; i++)
+                {
+                    if (Controls[i] is Label)
+                        Controls[i].Font = new Font("宋体", Controls[i].Font.Size - 10, FontStyle.Bold);
+                }
+            }
         }
 
         private void Process_Load(object sender, EventArgs e)
@@ -32,6 +41,7 @@ namespace UAS_KanBan
             Refresh.Interval = Setting.RefreshRate * 1000;
             Refresh.Start();
             WindowState = FormWindowState.Maximized;
+          
         }
 
         private void Refresh_Tick(object sender, EventArgs e)
@@ -72,12 +82,12 @@ namespace UAS_KanBan
             Line.Location = new Point(Line.Location.X, TopLine.Location.Y + (MidLine.Location.Y - TopLine.Location.Y - LineCode_label.Size.Height) / 2);
             班制.Location = new Point(班制.Location.X, MidLine.Location.Y + (BottomLine.Location.Y - MidLine.Location.Y - WorkShift_label.Size.Height) / 2);
             Logo.Size = new Size(Line1.Location.X - 20, BottomLine.Location.Y - TopLine.Location.Y - 20);
-            //机型.Location = new Point(机型_label.Location.X + 机型_label.Width + 30, 机型_label.Location.Y);
-            //投入.Location = new Point(投入_label.Location.X + 机型_label.Width + 30, 投入_label.Location.Y);
-            //产出.Location = new Point(产出_label.Location.X + 机型_label.Width + 30, 产出_label.Location.Y);
-            //直通率.Location = new Point(直通率_label.Location.X + 直通率_label.Width + 30, 直通率_label.Location.Y);
-            //收益率.Location = new Point(收益率_label.Location.X + 收益率_label.Width + 30, 收益率_label.Location.Y);
-            //故障数.Location = new Point(故障数_label.Location.X + 故障数_label.Width + 30, 故障数_label.Location.Y);
+            机型.Location = new Point(机型_label.Location.X + 机型_label.Width + 30, 机型_label.Location.Y);
+            投入.Location = new Point(投入_label.Location.X + 机型_label.Width + 30, 投入_label.Location.Y);
+            产出.Location = new Point(产出_label.Location.X + 机型_label.Width + 30, 产出_label.Location.Y);
+            直通率.Location = new Point(直通率_label.Location.X + 直通率_label.Width + 30, 直通率_label.Location.Y);
+            收益率.Location = new Point(收益率_label.Location.X + 收益率_label.Width + 30, 收益率_label.Location.Y);
+            故障数.Location = new Point(故障数_label.Location.X + 故障数_label.Width + 30, 故障数_label.Location.Y);
         }
 
         private void Process_FormClosing(object sender, FormClosingEventArgs e)