├── AutoSize-1 ├── AutoSize-1.sln └── AutoSize-1 │ ├── App.config │ ├── AutoSize-1.csproj │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Form2.Designer.cs │ ├── Form2.cs │ ├── Form2.resx │ ├── FormControl.cs │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── bin │ └── Debug │ │ ├── AutoSize-1.exe │ │ ├── AutoSize-1.exe.config │ │ ├── AutoSize-1.pdb │ │ ├── AutoSize-1.vshost.exe │ │ └── AutoSize-1.vshost.exe.config │ └── obj │ └── Debug │ ├── AutoSize-1.csproj.FileListAbsolute.txt │ ├── AutoSize-1.csproj.GenerateResource.Cache │ ├── AutoSize-1.csprojResolveAssemblyReference.cache │ ├── AutoSize-1.exe │ ├── AutoSize-1.pdb │ ├── AutoSize_1.Form1.resources │ ├── AutoSize_1.Form2.resources │ ├── AutoSize_1.Properties.Resources.resources │ ├── DesignTimeResolveAssemblyReferences.cache │ └── DesignTimeResolveAssemblyReferencesInput.cache └── README.md /AutoSize-1/AutoSize-1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoSize-1", "AutoSize-1\AutoSize-1.csproj", "{5D910879-EA16-4959-81F8-ADFB834A057B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {5D910879-EA16-4959-81F8-ADFB834A057B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {5D910879-EA16-4959-81F8-ADFB834A057B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {5D910879-EA16-4959-81F8-ADFB834A057B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {5D910879-EA16-4959-81F8-ADFB834A057B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/AutoSize-1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5D910879-EA16-4959-81F8-ADFB834A057B} 8 | WinExe 9 | Properties 10 | AutoSize_1 11 | AutoSize-1 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | Form 53 | 54 | 55 | Form1.cs 56 | 57 | 58 | Form 59 | 60 | 61 | Form2.cs 62 | 63 | 64 | 65 | 66 | 67 | Form1.cs 68 | 69 | 70 | Form2.cs 71 | 72 | 73 | ResXFileCodeGenerator 74 | Resources.Designer.cs 75 | Designer 76 | 77 | 78 | True 79 | Resources.resx 80 | 81 | 82 | SettingsSingleFileGenerator 83 | Settings.Designer.cs 84 | 85 | 86 | True 87 | Settings.settings 88 | True 89 | 90 | 91 | 92 | 93 | 94 | 95 | 102 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace AutoSize_1 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows 窗体设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 32 | System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 33 | System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); 34 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 35 | System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 36 | System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); 37 | this.panel1 = new System.Windows.Forms.Panel(); 38 | this.dataGridView1 = new System.Windows.Forms.DataGridView(); 39 | this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 40 | this.chart2 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 41 | this.panel1.SuspendLayout(); 42 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); 43 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); 44 | ((System.ComponentModel.ISupportInitialize)(this.chart2)).BeginInit(); 45 | this.SuspendLayout(); 46 | // 47 | // panel1 48 | // 49 | this.panel1.Controls.Add(this.dataGridView1); 50 | this.panel1.Location = new System.Drawing.Point(12, 12); 51 | this.panel1.Name = "panel1"; 52 | this.panel1.Size = new System.Drawing.Size(1026, 142); 53 | this.panel1.TabIndex = 3; 54 | // 55 | // dataGridView1 56 | // 57 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 58 | this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; 59 | this.dataGridView1.Location = new System.Drawing.Point(0, 0); 60 | this.dataGridView1.Name = "dataGridView1"; 61 | this.dataGridView1.RowTemplate.Height = 23; 62 | this.dataGridView1.Size = new System.Drawing.Size(1026, 142); 63 | this.dataGridView1.TabIndex = 0; 64 | // 65 | // chart1 66 | // 67 | chartArea1.Name = "ChartArea1"; 68 | this.chart1.ChartAreas.Add(chartArea1); 69 | legend1.Name = "Legend1"; 70 | this.chart1.Legends.Add(legend1); 71 | this.chart1.Location = new System.Drawing.Point(12, 172); 72 | this.chart1.Name = "chart1"; 73 | series1.ChartArea = "ChartArea1"; 74 | series1.Legend = "Legend1"; 75 | series1.Name = "Series1"; 76 | this.chart1.Series.Add(series1); 77 | this.chart1.Size = new System.Drawing.Size(453, 308); 78 | this.chart1.TabIndex = 4; 79 | this.chart1.Text = "chart1"; 80 | this.chart1.Click += new System.EventHandler(this.chart1_Click); 81 | // 82 | // chart2 83 | // 84 | chartArea2.Name = "ChartArea1"; 85 | this.chart2.ChartAreas.Add(chartArea2); 86 | legend2.Name = "Legend1"; 87 | this.chart2.Legends.Add(legend2); 88 | this.chart2.Location = new System.Drawing.Point(523, 172); 89 | this.chart2.Name = "chart2"; 90 | series2.ChartArea = "ChartArea1"; 91 | series2.Legend = "Legend1"; 92 | series2.Name = "Series1"; 93 | this.chart2.Series.Add(series2); 94 | this.chart2.Size = new System.Drawing.Size(515, 308); 95 | this.chart2.TabIndex = 4; 96 | this.chart2.Text = "chart1"; 97 | // 98 | // Form1 99 | // 100 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 101 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 102 | this.ClientSize = new System.Drawing.Size(1050, 528); 103 | this.Controls.Add(this.chart2); 104 | this.Controls.Add(this.chart1); 105 | this.Controls.Add(this.panel1); 106 | this.Name = "Form1"; 107 | this.Text = "Form1"; 108 | this.Load += new System.EventHandler(this.Form1_Load); 109 | this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged); 110 | this.panel1.ResumeLayout(false); 111 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); 112 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); 113 | ((System.ComponentModel.ISupportInitialize)(this.chart2)).EndInit(); 114 | this.ResumeLayout(false); 115 | 116 | } 117 | 118 | #endregion 119 | 120 | private System.Windows.Forms.Panel panel1; 121 | private System.Windows.Forms.DataGridView dataGridView1; 122 | private System.Windows.Forms.DataVisualization.Charting.Chart chart1; 123 | private System.Windows.Forms.DataVisualization.Charting.Chart chart2; 124 | } 125 | } 126 | 127 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace AutoSize_1 12 | { 13 | public partial class Form1 : Form 14 | { 15 | //AutoSizeFormClass asc = new AutoSizeFormClass(); 16 | public Form1() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void Form1_Load(object sender, EventArgs e) 22 | { 23 | //asc.controllInitializeSize(this); 24 | } 25 | 26 | private void Form1_SizeChanged(object sender, EventArgs e) 27 | { 28 | //asc.controlAutoSize(this); 29 | } 30 | 31 | private void chart1_Click(object sender, EventArgs e) 32 | { 33 | 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Form1.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Form2.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace AutoSize_1 2 | { 3 | partial class Form2 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 32 | System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 33 | System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series(); 34 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 35 | System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 36 | System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series(); 37 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 38 | System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 39 | System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); 40 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 41 | System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 42 | System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); 43 | this.panel1 = new System.Windows.Forms.Panel(); 44 | this.chart2 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 45 | this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 46 | this.monthCalendar1 = new System.Windows.Forms.MonthCalendar(); 47 | this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); 48 | this.checkBox9 = new System.Windows.Forms.CheckBox(); 49 | this.checkBox6 = new System.Windows.Forms.CheckBox(); 50 | this.checkBox3 = new System.Windows.Forms.CheckBox(); 51 | this.checkBox8 = new System.Windows.Forms.CheckBox(); 52 | this.checkBox5 = new System.Windows.Forms.CheckBox(); 53 | this.checkBox2 = new System.Windows.Forms.CheckBox(); 54 | this.checkBox7 = new System.Windows.Forms.CheckBox(); 55 | this.checkBox4 = new System.Windows.Forms.CheckBox(); 56 | this.checkBox1 = new System.Windows.Forms.CheckBox(); 57 | this.button3 = new System.Windows.Forms.Button(); 58 | this.button2 = new System.Windows.Forms.Button(); 59 | this.button1 = new System.Windows.Forms.Button(); 60 | this.messageQueue1 = new System.Messaging.MessageQueue(); 61 | this.chart3 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 62 | this.chart4 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 63 | this.checkBox10 = new System.Windows.Forms.CheckBox(); 64 | this.checkBox11 = new System.Windows.Forms.CheckBox(); 65 | this.checkBox12 = new System.Windows.Forms.CheckBox(); 66 | this.checkBox13 = new System.Windows.Forms.CheckBox(); 67 | this.checkBox14 = new System.Windows.Forms.CheckBox(); 68 | this.checkBox15 = new System.Windows.Forms.CheckBox(); 69 | this.checkBox16 = new System.Windows.Forms.CheckBox(); 70 | this.checkBox17 = new System.Windows.Forms.CheckBox(); 71 | this.checkBox18 = new System.Windows.Forms.CheckBox(); 72 | this.button4 = new System.Windows.Forms.Button(); 73 | this.button5 = new System.Windows.Forms.Button(); 74 | this.panel1.SuspendLayout(); 75 | ((System.ComponentModel.ISupportInitialize)(this.chart2)).BeginInit(); 76 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); 77 | ((System.ComponentModel.ISupportInitialize)(this.chart3)).BeginInit(); 78 | ((System.ComponentModel.ISupportInitialize)(this.chart4)).BeginInit(); 79 | this.SuspendLayout(); 80 | // 81 | // panel1 82 | // 83 | this.panel1.Controls.Add(this.chart4); 84 | this.panel1.Controls.Add(this.chart3); 85 | this.panel1.Controls.Add(this.chart2); 86 | this.panel1.Controls.Add(this.chart1); 87 | this.panel1.Controls.Add(this.monthCalendar1); 88 | this.panel1.Controls.Add(this.dateTimePicker1); 89 | this.panel1.Controls.Add(this.checkBox18); 90 | this.panel1.Controls.Add(this.checkBox9); 91 | this.panel1.Controls.Add(this.checkBox17); 92 | this.panel1.Controls.Add(this.checkBox6); 93 | this.panel1.Controls.Add(this.checkBox16); 94 | this.panel1.Controls.Add(this.checkBox3); 95 | this.panel1.Controls.Add(this.checkBox15); 96 | this.panel1.Controls.Add(this.checkBox8); 97 | this.panel1.Controls.Add(this.checkBox14); 98 | this.panel1.Controls.Add(this.checkBox5); 99 | this.panel1.Controls.Add(this.checkBox13); 100 | this.panel1.Controls.Add(this.checkBox2); 101 | this.panel1.Controls.Add(this.checkBox12); 102 | this.panel1.Controls.Add(this.checkBox7); 103 | this.panel1.Controls.Add(this.checkBox11); 104 | this.panel1.Controls.Add(this.checkBox10); 105 | this.panel1.Controls.Add(this.checkBox4); 106 | this.panel1.Controls.Add(this.checkBox1); 107 | this.panel1.Controls.Add(this.button3); 108 | this.panel1.Controls.Add(this.button5); 109 | this.panel1.Controls.Add(this.button4); 110 | this.panel1.Controls.Add(this.button2); 111 | this.panel1.Controls.Add(this.button1); 112 | this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; 113 | this.panel1.Location = new System.Drawing.Point(0, 0); 114 | this.panel1.Name = "panel1"; 115 | this.panel1.Size = new System.Drawing.Size(1569, 794); 116 | this.panel1.TabIndex = 0; 117 | // 118 | // chart2 119 | // 120 | chartArea3.Name = "ChartArea1"; 121 | this.chart2.ChartAreas.Add(chartArea3); 122 | legend3.Name = "Legend1"; 123 | this.chart2.Legends.Add(legend3); 124 | this.chart2.Location = new System.Drawing.Point(436, 265); 125 | this.chart2.Name = "chart2"; 126 | series3.ChartArea = "ChartArea1"; 127 | series3.Legend = "Legend1"; 128 | series3.Name = "Series1"; 129 | this.chart2.Series.Add(series3); 130 | this.chart2.Size = new System.Drawing.Size(300, 300); 131 | this.chart2.TabIndex = 4; 132 | this.chart2.Text = "chart1"; 133 | // 134 | // chart1 135 | // 136 | chartArea4.Name = "ChartArea1"; 137 | this.chart1.ChartAreas.Add(chartArea4); 138 | legend4.Name = "Legend1"; 139 | this.chart1.Legends.Add(legend4); 140 | this.chart1.Location = new System.Drawing.Point(18, 265); 141 | this.chart1.Name = "chart1"; 142 | series4.ChartArea = "ChartArea1"; 143 | series4.Legend = "Legend1"; 144 | series4.Name = "Series1"; 145 | this.chart1.Series.Add(series4); 146 | this.chart1.Size = new System.Drawing.Size(300, 300); 147 | this.chart1.TabIndex = 4; 148 | this.chart1.Text = "chart1"; 149 | // 150 | // monthCalendar1 151 | // 152 | this.monthCalendar1.Location = new System.Drawing.Point(1300, 213); 153 | this.monthCalendar1.Name = "monthCalendar1"; 154 | this.monthCalendar1.TabIndex = 3; 155 | // 156 | // dateTimePicker1 157 | // 158 | this.dateTimePicker1.Location = new System.Drawing.Point(436, 208); 159 | this.dateTimePicker1.Name = "dateTimePicker1"; 160 | this.dateTimePicker1.Size = new System.Drawing.Size(200, 21); 161 | this.dateTimePicker1.TabIndex = 2; 162 | // 163 | // checkBox9 164 | // 165 | this.checkBox9.AutoSize = true; 166 | this.checkBox9.Location = new System.Drawing.Point(212, 213); 167 | this.checkBox9.Name = "checkBox9"; 168 | this.checkBox9.Size = new System.Drawing.Size(78, 16); 169 | this.checkBox9.TabIndex = 1; 170 | this.checkBox9.Text = "checkBox1"; 171 | this.checkBox9.UseVisualStyleBackColor = true; 172 | // 173 | // checkBox6 174 | // 175 | this.checkBox6.AutoSize = true; 176 | this.checkBox6.Location = new System.Drawing.Point(128, 213); 177 | this.checkBox6.Name = "checkBox6"; 178 | this.checkBox6.Size = new System.Drawing.Size(78, 16); 179 | this.checkBox6.TabIndex = 1; 180 | this.checkBox6.Text = "checkBox1"; 181 | this.checkBox6.UseVisualStyleBackColor = true; 182 | // 183 | // checkBox3 184 | // 185 | this.checkBox3.AutoSize = true; 186 | this.checkBox3.Location = new System.Drawing.Point(44, 213); 187 | this.checkBox3.Name = "checkBox3"; 188 | this.checkBox3.Size = new System.Drawing.Size(78, 16); 189 | this.checkBox3.TabIndex = 1; 190 | this.checkBox3.Text = "checkBox1"; 191 | this.checkBox3.UseVisualStyleBackColor = true; 192 | // 193 | // checkBox8 194 | // 195 | this.checkBox8.AutoSize = true; 196 | this.checkBox8.Location = new System.Drawing.Point(212, 191); 197 | this.checkBox8.Name = "checkBox8"; 198 | this.checkBox8.Size = new System.Drawing.Size(78, 16); 199 | this.checkBox8.TabIndex = 1; 200 | this.checkBox8.Text = "checkBox1"; 201 | this.checkBox8.UseVisualStyleBackColor = true; 202 | // 203 | // checkBox5 204 | // 205 | this.checkBox5.AutoSize = true; 206 | this.checkBox5.Location = new System.Drawing.Point(128, 191); 207 | this.checkBox5.Name = "checkBox5"; 208 | this.checkBox5.Size = new System.Drawing.Size(78, 16); 209 | this.checkBox5.TabIndex = 1; 210 | this.checkBox5.Text = "checkBox1"; 211 | this.checkBox5.UseVisualStyleBackColor = true; 212 | // 213 | // checkBox2 214 | // 215 | this.checkBox2.AutoSize = true; 216 | this.checkBox2.Location = new System.Drawing.Point(44, 191); 217 | this.checkBox2.Name = "checkBox2"; 218 | this.checkBox2.Size = new System.Drawing.Size(78, 16); 219 | this.checkBox2.TabIndex = 1; 220 | this.checkBox2.Text = "checkBox1"; 221 | this.checkBox2.UseVisualStyleBackColor = true; 222 | // 223 | // checkBox7 224 | // 225 | this.checkBox7.AutoSize = true; 226 | this.checkBox7.Location = new System.Drawing.Point(212, 169); 227 | this.checkBox7.Name = "checkBox7"; 228 | this.checkBox7.Size = new System.Drawing.Size(78, 16); 229 | this.checkBox7.TabIndex = 1; 230 | this.checkBox7.Text = "checkBox1"; 231 | this.checkBox7.UseVisualStyleBackColor = true; 232 | // 233 | // checkBox4 234 | // 235 | this.checkBox4.AutoSize = true; 236 | this.checkBox4.Location = new System.Drawing.Point(128, 169); 237 | this.checkBox4.Name = "checkBox4"; 238 | this.checkBox4.Size = new System.Drawing.Size(78, 16); 239 | this.checkBox4.TabIndex = 1; 240 | this.checkBox4.Text = "checkBox1"; 241 | this.checkBox4.UseVisualStyleBackColor = true; 242 | // 243 | // checkBox1 244 | // 245 | this.checkBox1.AutoSize = true; 246 | this.checkBox1.Location = new System.Drawing.Point(44, 169); 247 | this.checkBox1.Name = "checkBox1"; 248 | this.checkBox1.Size = new System.Drawing.Size(78, 16); 249 | this.checkBox1.TabIndex = 1; 250 | this.checkBox1.Text = "checkBox1"; 251 | this.checkBox1.UseVisualStyleBackColor = true; 252 | // 253 | // button3 254 | // 255 | this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 256 | this.button3.Font = new System.Drawing.Font("宋体", 45F); 257 | this.button3.Location = new System.Drawing.Point(1251, 12); 258 | this.button3.Name = "button3"; 259 | this.button3.Size = new System.Drawing.Size(306, 138); 260 | this.button3.TabIndex = 0; 261 | this.button3.Text = "看我的字体变化"; 262 | this.button3.UseVisualStyleBackColor = true; 263 | // 264 | // button2 265 | // 266 | this.button2.Anchor = System.Windows.Forms.AnchorStyles.Top; 267 | this.button2.Font = new System.Drawing.Font("宋体", 15F); 268 | this.button2.Location = new System.Drawing.Point(436, 12); 269 | this.button2.Name = "button2"; 270 | this.button2.Size = new System.Drawing.Size(306, 138); 271 | this.button2.TabIndex = 0; 272 | this.button2.Text = "button1"; 273 | this.button2.UseVisualStyleBackColor = true; 274 | // 275 | // button1 276 | // 277 | this.button1.Font = new System.Drawing.Font("宋体", 15F); 278 | this.button1.Location = new System.Drawing.Point(12, 12); 279 | this.button1.Name = "button1"; 280 | this.button1.Size = new System.Drawing.Size(306, 138); 281 | this.button1.TabIndex = 0; 282 | this.button1.Text = "界面还原"; 283 | this.button1.UseVisualStyleBackColor = true; 284 | this.button1.Click += new System.EventHandler(this.button1_Click); 285 | // 286 | // messageQueue1 287 | // 288 | this.messageQueue1.MessageReadPropertyFilter.LookupId = true; 289 | this.messageQueue1.SynchronizingObject = this; 290 | // 291 | // chart3 292 | // 293 | chartArea2.Name = "ChartArea1"; 294 | this.chart3.ChartAreas.Add(chartArea2); 295 | legend2.Name = "Legend1"; 296 | this.chart3.Legends.Add(legend2); 297 | this.chart3.Location = new System.Drawing.Point(843, 427); 298 | this.chart3.Name = "chart3"; 299 | series2.ChartArea = "ChartArea1"; 300 | series2.Legend = "Legend1"; 301 | series2.Name = "Series1"; 302 | this.chart3.Series.Add(series2); 303 | this.chart3.Size = new System.Drawing.Size(300, 300); 304 | this.chart3.TabIndex = 4; 305 | this.chart3.Text = "chart1"; 306 | // 307 | // chart4 308 | // 309 | chartArea1.Name = "ChartArea1"; 310 | this.chart4.ChartAreas.Add(chartArea1); 311 | legend1.Name = "Legend1"; 312 | this.chart4.Legends.Add(legend1); 313 | this.chart4.Location = new System.Drawing.Point(1220, 427); 314 | this.chart4.Name = "chart4"; 315 | series1.ChartArea = "ChartArea1"; 316 | series1.Legend = "Legend1"; 317 | series1.Name = "Series1"; 318 | this.chart4.Series.Add(series1); 319 | this.chart4.Size = new System.Drawing.Size(300, 300); 320 | this.chart4.TabIndex = 4; 321 | this.chart4.Text = "chart1"; 322 | // 323 | // checkBox10 324 | // 325 | this.checkBox10.AutoSize = true; 326 | this.checkBox10.Location = new System.Drawing.Point(436, 620); 327 | this.checkBox10.Name = "checkBox10"; 328 | this.checkBox10.Size = new System.Drawing.Size(78, 16); 329 | this.checkBox10.TabIndex = 1; 330 | this.checkBox10.Text = "checkBox1"; 331 | this.checkBox10.UseVisualStyleBackColor = true; 332 | // 333 | // checkBox11 334 | // 335 | this.checkBox11.AutoSize = true; 336 | this.checkBox11.Location = new System.Drawing.Point(520, 620); 337 | this.checkBox11.Name = "checkBox11"; 338 | this.checkBox11.Size = new System.Drawing.Size(78, 16); 339 | this.checkBox11.TabIndex = 1; 340 | this.checkBox11.Text = "checkBox1"; 341 | this.checkBox11.UseVisualStyleBackColor = true; 342 | // 343 | // checkBox12 344 | // 345 | this.checkBox12.AutoSize = true; 346 | this.checkBox12.Location = new System.Drawing.Point(604, 620); 347 | this.checkBox12.Name = "checkBox12"; 348 | this.checkBox12.Size = new System.Drawing.Size(78, 16); 349 | this.checkBox12.TabIndex = 1; 350 | this.checkBox12.Text = "checkBox1"; 351 | this.checkBox12.UseVisualStyleBackColor = true; 352 | // 353 | // checkBox13 354 | // 355 | this.checkBox13.AutoSize = true; 356 | this.checkBox13.Location = new System.Drawing.Point(436, 642); 357 | this.checkBox13.Name = "checkBox13"; 358 | this.checkBox13.Size = new System.Drawing.Size(78, 16); 359 | this.checkBox13.TabIndex = 1; 360 | this.checkBox13.Text = "checkBox1"; 361 | this.checkBox13.UseVisualStyleBackColor = true; 362 | // 363 | // checkBox14 364 | // 365 | this.checkBox14.AutoSize = true; 366 | this.checkBox14.Location = new System.Drawing.Point(520, 642); 367 | this.checkBox14.Name = "checkBox14"; 368 | this.checkBox14.Size = new System.Drawing.Size(78, 16); 369 | this.checkBox14.TabIndex = 1; 370 | this.checkBox14.Text = "checkBox1"; 371 | this.checkBox14.UseVisualStyleBackColor = true; 372 | // 373 | // checkBox15 374 | // 375 | this.checkBox15.AutoSize = true; 376 | this.checkBox15.Location = new System.Drawing.Point(604, 642); 377 | this.checkBox15.Name = "checkBox15"; 378 | this.checkBox15.Size = new System.Drawing.Size(78, 16); 379 | this.checkBox15.TabIndex = 1; 380 | this.checkBox15.Text = "checkBox1"; 381 | this.checkBox15.UseVisualStyleBackColor = true; 382 | // 383 | // checkBox16 384 | // 385 | this.checkBox16.AutoSize = true; 386 | this.checkBox16.Location = new System.Drawing.Point(436, 664); 387 | this.checkBox16.Name = "checkBox16"; 388 | this.checkBox16.Size = new System.Drawing.Size(78, 16); 389 | this.checkBox16.TabIndex = 1; 390 | this.checkBox16.Text = "checkBox1"; 391 | this.checkBox16.UseVisualStyleBackColor = true; 392 | // 393 | // checkBox17 394 | // 395 | this.checkBox17.AutoSize = true; 396 | this.checkBox17.Location = new System.Drawing.Point(520, 664); 397 | this.checkBox17.Name = "checkBox17"; 398 | this.checkBox17.Size = new System.Drawing.Size(78, 16); 399 | this.checkBox17.TabIndex = 1; 400 | this.checkBox17.Text = "checkBox1"; 401 | this.checkBox17.UseVisualStyleBackColor = true; 402 | // 403 | // checkBox18 404 | // 405 | this.checkBox18.AutoSize = true; 406 | this.checkBox18.Location = new System.Drawing.Point(604, 664); 407 | this.checkBox18.Name = "checkBox18"; 408 | this.checkBox18.Size = new System.Drawing.Size(78, 16); 409 | this.checkBox18.TabIndex = 1; 410 | this.checkBox18.Text = "checkBox1"; 411 | this.checkBox18.UseVisualStyleBackColor = true; 412 | // 413 | // button4 414 | // 415 | this.button4.Anchor = System.Windows.Forms.AnchorStyles.Top; 416 | this.button4.Font = new System.Drawing.Font("宋体", 15F); 417 | this.button4.Location = new System.Drawing.Point(843, 12); 418 | this.button4.Name = "button4"; 419 | this.button4.Size = new System.Drawing.Size(306, 138); 420 | this.button4.TabIndex = 0; 421 | this.button4.Text = "button1"; 422 | this.button4.UseVisualStyleBackColor = true; 423 | // 424 | // button5 425 | // 426 | this.button5.Anchor = System.Windows.Forms.AnchorStyles.Top; 427 | this.button5.Font = new System.Drawing.Font("宋体", 15F); 428 | this.button5.Location = new System.Drawing.Point(843, 213); 429 | this.button5.Name = "button5"; 430 | this.button5.Size = new System.Drawing.Size(306, 138); 431 | this.button5.TabIndex = 0; 432 | this.button5.Text = "button1"; 433 | this.button5.UseVisualStyleBackColor = true; 434 | // 435 | // Form2 436 | // 437 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 438 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 439 | this.ClientSize = new System.Drawing.Size(1569, 794); 440 | this.Controls.Add(this.panel1); 441 | this.Name = "Form2"; 442 | this.Text = "Form2"; 443 | this.Load += new System.EventHandler(this.Form2_Load); 444 | this.panel1.ResumeLayout(false); 445 | this.panel1.PerformLayout(); 446 | ((System.ComponentModel.ISupportInitialize)(this.chart2)).EndInit(); 447 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); 448 | ((System.ComponentModel.ISupportInitialize)(this.chart3)).EndInit(); 449 | ((System.ComponentModel.ISupportInitialize)(this.chart4)).EndInit(); 450 | this.ResumeLayout(false); 451 | 452 | } 453 | 454 | #endregion 455 | 456 | private System.Windows.Forms.Panel panel1; 457 | private System.Windows.Forms.Button button3; 458 | private System.Windows.Forms.Button button2; 459 | private System.Windows.Forms.Button button1; 460 | private System.Windows.Forms.DataVisualization.Charting.Chart chart2; 461 | private System.Windows.Forms.DataVisualization.Charting.Chart chart1; 462 | private System.Windows.Forms.MonthCalendar monthCalendar1; 463 | private System.Windows.Forms.DateTimePicker dateTimePicker1; 464 | private System.Windows.Forms.CheckBox checkBox9; 465 | private System.Windows.Forms.CheckBox checkBox6; 466 | private System.Windows.Forms.CheckBox checkBox3; 467 | private System.Windows.Forms.CheckBox checkBox8; 468 | private System.Windows.Forms.CheckBox checkBox5; 469 | private System.Windows.Forms.CheckBox checkBox2; 470 | private System.Windows.Forms.CheckBox checkBox7; 471 | private System.Windows.Forms.CheckBox checkBox4; 472 | private System.Windows.Forms.CheckBox checkBox1; 473 | private System.Messaging.MessageQueue messageQueue1; 474 | private System.Windows.Forms.DataVisualization.Charting.Chart chart4; 475 | private System.Windows.Forms.DataVisualization.Charting.Chart chart3; 476 | private System.Windows.Forms.CheckBox checkBox18; 477 | private System.Windows.Forms.CheckBox checkBox17; 478 | private System.Windows.Forms.CheckBox checkBox16; 479 | private System.Windows.Forms.CheckBox checkBox15; 480 | private System.Windows.Forms.CheckBox checkBox14; 481 | private System.Windows.Forms.CheckBox checkBox13; 482 | private System.Windows.Forms.CheckBox checkBox12; 483 | private System.Windows.Forms.CheckBox checkBox11; 484 | private System.Windows.Forms.CheckBox checkBox10; 485 | private System.Windows.Forms.Button button5; 486 | private System.Windows.Forms.Button button4; 487 | } 488 | } -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Form2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Diagnostics; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace AutoSize_1 13 | { 14 | 15 | public partial class Form2 : Form 16 | { 17 | private int formStartX = 0; 18 | private int formStartY = 0; 19 | 20 | FormControl fc = null; 21 | public Form2() 22 | { 23 | InitializeComponent(); 24 | } 25 | private void Form2_Load(object sender, EventArgs e) 26 | { 27 | fc = new FormControl(this); 28 | fc.GetInit(this, fc); 29 | 30 | this.formStartX = this.Width; 31 | this.formStartY = this.Height; 32 | 33 | 34 | } 35 | 36 | private void button1_Click(object sender, EventArgs e) 37 | { 38 | //界面还原的按钮 39 | this.Width = this.formStartX; 40 | this.Height = this.formStartY; 41 | 42 | fc.Reset(this, fc); 43 | } 44 | 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Form2.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/FormControl.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace AutoSize_1 12 | { 13 | public class FormControl 14 | { 15 | /// 16 | /// 不 17 | /// 18 | public string ControlName { get; set; } 19 | public Control Paraent { get; set; } 20 | public List Child { get; set; } 21 | /// 22 | /// 记录当前的位置, 23 | /// 24 | public int Left { get; set; } 25 | /// 26 | /// 记录最开始的数据,用来恢复窗体布局 27 | /// 28 | public int InitLeft { get; set; } 29 | public int Top { get; set; } 30 | public int InitTop { get; set; } 31 | 32 | public int Height { get; set; } 33 | public int InitHeight { get; set; } 34 | 35 | public int Width { get; set; } 36 | public int InitWidth { get; set; } 37 | /// 38 | /// 字体大小 39 | /// 40 | public double FontSize { get; set; } 41 | public double InitFontSize { get; set; } 42 | 43 | /// 44 | /// 作为中间变量,记录每次变化后的最上层paraent 窗体的大小-X 45 | /// 只有最上层的控件的有意义,子控件也有这个属性,但是在计算缩放时,因所有控件缩放比例一样,只用的最上层控件的 46 | /// 在MyResize 事件中。 47 | /// 48 | private int RootParaentX; 49 | private int RootParaentY; 50 | 51 | 52 | public FormControl(Control con) 53 | { 54 | this.Paraent = con; 55 | this.ControlName = con.Name; 56 | 57 | this.Left = con.Left; 58 | this.Top = con.Top; 59 | this.Width = con.Width; 60 | this.Height = con.Height; 61 | 62 | this.InitLeft = con.Left; 63 | this.InitTop = con.Top; 64 | this.InitWidth = con.Width; 65 | this.InitHeight = con.Height; 66 | 67 | this.FontSize = con.Font.Size; 68 | this.InitFontSize = con.Font.Size; 69 | 70 | this.Child = new List(); 71 | 72 | this.RootParaentX = this.Width; 73 | this.RootParaentY = this.Height; 74 | 75 | 76 | 77 | 78 | Form form = con as Form; 79 | if (form != null) 80 | { 81 | form.Resize += this.MyResize; 82 | } 83 | 84 | 85 | //GetInit(con); 86 | } 87 | /// 88 | /// 记录所有初始值 89 | /// 90 | /// 91 | /// 92 | public void GetInit(Control cons, FormControl paraent) 93 | { 94 | if (cons.Controls.Count > 0) 95 | { 96 | foreach (Control con in cons.Controls) 97 | { 98 | con.Anchor = AnchorStyles.Left | AnchorStyles.Top; 99 | 100 | FormControl fc = new FormControl(con); 101 | 102 | fc.GetInit(con, fc); 103 | paraent.Child.Add(fc); 104 | } 105 | } 106 | else 107 | { 108 | return; 109 | } 110 | 111 | } 112 | /// 113 | /// 回到初始状态 114 | /// 115 | /// 116 | public void Reset(Control cons, FormControl fcs) 117 | { 118 | if (cons.Controls.Count > 0) 119 | { 120 | foreach (Control con in cons.Controls) 121 | { 122 | foreach (FormControl fc in fcs.Child) 123 | { 124 | if (fc.ControlName == con.Name) 125 | { 126 | con.Left = fc.InitLeft; 127 | con.Top = fc.InitTop; 128 | con.Width = fc.Width; 129 | con.Height = fc.Height; 130 | 131 | Single currentSize = Convert.ToSingle(fc.InitFontSize); 132 | con.Font = new Font(con.Font.Name, currentSize, con.Font.Style, con.Font.Unit); 133 | 134 | fc.Reset(con, fc); 135 | } 136 | } 137 | } 138 | } 139 | 140 | } 141 | 142 | /// 143 | /// 窗体变化后自适应 144 | /// 145 | /// 146 | public void MyResize(object sender, EventArgs e) 147 | { 148 | double newx = Convert.ToDouble(this.Paraent.Width) / RootParaentX; 149 | double newy = Convert.ToDouble(this.Paraent.Height) / RootParaentY; 150 | 151 | RootParaentX = this.Paraent.Width; 152 | RootParaentY = this.Paraent.Height; 153 | 154 | this.SetControls(newx,newy, this.Paraent); 155 | 156 | 157 | } 158 | 159 | private void SetControls(double newX, double newY, Control cons)//改变控件的大小 160 | { 161 | foreach (Control con in cons.Controls) 162 | { 163 | //Debug.Print("变化前:" + con.Width + " " + con.Height + " " + con.Left + " " + con.Height); 164 | double a = Convert.ToSingle(con.Width * newX); 165 | con.Width = (int)a; 166 | a = Convert.ToSingle(con.Height * newY); 167 | con.Height = (int)a; 168 | a = Convert.ToSingle(con.Left * newX); 169 | con.Left = (int)a; 170 | a = Convert.ToSingle(con.Top * newY); 171 | con.Top = (int)a; 172 | 173 | 174 | 175 | //Debug.Print("变化后:" + con.Width + " " + con.Height + " " + con.Left + " " + con.Height); 176 | 177 | Single currentSize = Convert.ToSingle(con.Font.Size * 0.5 * (newY + newX)); 178 | con.Font = new Font(con.Font.Name, currentSize, con.Font.Style, con.Font.Unit); 179 | if (con.Controls.Count > 0) 180 | { 181 | SetControls(newX, newY, con); 182 | } 183 | } 184 | } 185 | 186 | 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace AutoSize_1 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form2()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("AutoSize-1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("AutoSize-1")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("5d910879-ea16-4959-81f8-adfb834a057b")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AutoSize_1.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoSize_1.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AutoSize_1.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/bin/Debug/AutoSize-1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/bin/Debug/AutoSize-1.exe -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/bin/Debug/AutoSize-1.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/bin/Debug/AutoSize-1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/bin/Debug/AutoSize-1.pdb -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/bin/Debug/AutoSize-1.vshost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/bin/Debug/AutoSize-1.vshost.exe -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/bin/Debug/AutoSize-1.vshost.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\bin\Debug\AutoSize-1.exe.config 2 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\bin\Debug\AutoSize-1.exe 3 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\bin\Debug\AutoSize-1.pdb 4 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\obj\Debug\AutoSize-1.csprojResolveAssemblyReference.cache 5 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\obj\Debug\AutoSize_1.Form1.resources 6 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\obj\Debug\AutoSize_1.Properties.Resources.resources 7 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\obj\Debug\AutoSize-1.csproj.GenerateResource.Cache 8 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\obj\Debug\AutoSize-1.exe 9 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\obj\Debug\AutoSize-1.pdb 10 | E:\codeStudy\8-C#\DemoAutoSizeForm\AutoSize-1\AutoSize-1\obj\Debug\AutoSize_1.Form2.resources 11 | -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.csproj.GenerateResource.Cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.csproj.GenerateResource.Cache -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.exe -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/AutoSize-1.pdb -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/AutoSize_1.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/AutoSize_1.Form1.resources -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/AutoSize_1.Form2.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/AutoSize_1.Form2.resources -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/AutoSize_1.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/AutoSize_1.Properties.Resources.resources -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /AutoSize-1/AutoSize-1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamonDBT/winform-autosize-dpi/4dfc8d6e8cd6665701037ecc1f8c383b138c6962/AutoSize-1/AutoSize-1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # winform-autosize-dpi 2 | 3 | 4 | winform 窗体自适应不同屏幕、分辨率 的类。 5 | 开发环境 VS2015. 6 | 下载后,在你的form窗体程序中,添加类 FormControl. 7 | 然后按照 Form2 窗体下的代码,引用即可, 8 | 9 | 10 | --------------------------------------------------------------------------------