diff --git a/RecurseWindowTest.sln b/RecurseWindowTest.sln new file mode 100644 index 0000000..62ce26c --- /dev/null +++ b/RecurseWindowTest.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RecurseWindowTest", "RecurseWindowTest\RecurseWindowTest.csproj", "{7A29E508-F65F-42C0-9C79-3AA40626B4DB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7A29E508-F65F-42C0-9C79-3AA40626B4DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A29E508-F65F-42C0-9C79-3AA40626B4DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A29E508-F65F-42C0-9C79-3AA40626B4DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A29E508-F65F-42C0-9C79-3AA40626B4DB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A4E41116-76D5-4129-9447-CE436BBB0A2E} + EndGlobalSection +EndGlobal diff --git a/RecurseWindowTest/App.config b/RecurseWindowTest/App.config new file mode 100644 index 0000000..5754728 --- /dev/null +++ b/RecurseWindowTest/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/RecurseWindowTest/Form1.Designer.cs b/RecurseWindowTest/Form1.Designer.cs new file mode 100644 index 0000000..c4165f4 --- /dev/null +++ b/RecurseWindowTest/Form1.Designer.cs @@ -0,0 +1,67 @@ + +namespace RecurseWindowTest +{ + partial class Form1 + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором форм Windows + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox1.Image = global::RecurseWindowTest.Properties.Resources.car; + this.pictureBox1.Location = new System.Drawing.Point(0, 0); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(784, 461); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(784, 461); + this.Controls.Add(this.pictureBox1); + this.Name = "Form1"; + this.Text = "Форма"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + } +} + diff --git a/RecurseWindowTest/Form1.cs b/RecurseWindowTest/Form1.cs new file mode 100644 index 0000000..bb68396 --- /dev/null +++ b/RecurseWindowTest/Form1.cs @@ -0,0 +1,73 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace RecurseWindowTest +{ + public partial class Form1 : Form + { + private int iter_num; + private int mode; + public Form1(int iteration, int _mode = 0) + { + InitializeComponent(); + iter_num = iteration; + mode = _mode; + Size = GetSizeByIterNum(); + Text = $"{Size.Width}x{Size.Height}"; + if (mode == 2) + new Form1(iter_num+1, mode).ShowDialog(); + } + + private void pictureBox1_Click(object sender, EventArgs e) + { + new Form1(iter_num+1, mode).ShowDialog(); + } + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + switch (mode) + { + case 1: + case 2: + e.Cancel = true; + break; + default: + if (Size.Width < 300) + Application.Exit(); + /*else + new Form1(iter_num + 1, mode).ShowDialog();*/ + break; + } + } + + private Size GetSizeByIterNum() + { + int width = 800; + for (int i = 0; i < iter_num; ++i) + { + try + { + width -= (width / 100 * 20); + } + catch (Exception) { + MessageBox.Show("w!!!", "Отладка"); + } + } + + int height = 500; + for (int j = 0; j < iter_num; ++j) + { + try + { + height -= (height / 100 * 20); + } + catch (Exception) { + MessageBox.Show("h!!!", "Отладка"); + } + } + + return new Size(width, height); + } + } +} diff --git a/RecurseWindowTest/Form1.resx b/RecurseWindowTest/Form1.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/RecurseWindowTest/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/RecurseWindowTest/Program.cs b/RecurseWindowTest/Program.cs new file mode 100644 index 0000000..1debc5d --- /dev/null +++ b/RecurseWindowTest/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace RecurseWindowTest +{ + static class Program + { + /// + /// Главная точка входа для приложения. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1(1, 0)); + } + } +} diff --git a/RecurseWindowTest/Properties/AssemblyInfo.cs b/RecurseWindowTest/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6a06dbe --- /dev/null +++ b/RecurseWindowTest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанных со сборкой. +[assembly: AssemblyTitle("RecurseWindowTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("RecurseWindowTest")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, следует установить атрибут ComVisible в TRUE для этого типа. +[assembly: ComVisible(false)] + +// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +[assembly: Guid("7a29e508-f65f-42c0-9c79-3aa40626b4db")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +// Можно задать все значения или принять номера сборки и редакции по умолчанию +// используя "*", как показано ниже: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RecurseWindowTest/Properties/Resources.Designer.cs b/RecurseWindowTest/Properties/Resources.Designer.cs new file mode 100644 index 0000000..47e4d04 --- /dev/null +++ b/RecurseWindowTest/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace RecurseWindowTest.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RecurseWindowTest.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap car { + get { + object obj = ResourceManager.GetObject("car", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/RecurseWindowTest/Properties/Resources.resx b/RecurseWindowTest/Properties/Resources.resx new file mode 100644 index 0000000..c1ddc64 --- /dev/null +++ b/RecurseWindowTest/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + car.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/RecurseWindowTest/Properties/Settings.Designer.cs b/RecurseWindowTest/Properties/Settings.Designer.cs new file mode 100644 index 0000000..7fe3deb --- /dev/null +++ b/RecurseWindowTest/Properties/Settings.Designer.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace RecurseWindowTest.Properties +{ + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/RecurseWindowTest/Properties/Settings.settings b/RecurseWindowTest/Properties/Settings.settings new file mode 100644 index 0000000..abf36c5 --- /dev/null +++ b/RecurseWindowTest/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/RecurseWindowTest/Properties/car.jpg b/RecurseWindowTest/Properties/car.jpg new file mode 100644 index 0000000..2d6ae74 Binary files /dev/null and b/RecurseWindowTest/Properties/car.jpg differ diff --git a/RecurseWindowTest/RecurseWindowTest.csproj b/RecurseWindowTest/RecurseWindowTest.csproj new file mode 100644 index 0000000..662fbd0 --- /dev/null +++ b/RecurseWindowTest/RecurseWindowTest.csproj @@ -0,0 +1,87 @@ + + + + + Debug + AnyCPU + {7A29E508-F65F-42C0-9C79-3AA40626B4DB} + WinExe + RecurseWindowTest + RecurseWindowTest + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + \ No newline at end of file diff --git a/RecurseWindowTest/bin/Debug/RecurseWindowTest.exe b/RecurseWindowTest/bin/Debug/RecurseWindowTest.exe new file mode 100644 index 0000000..00d40b1 Binary files /dev/null and b/RecurseWindowTest/bin/Debug/RecurseWindowTest.exe differ diff --git a/RecurseWindowTest/bin/Debug/RecurseWindowTest.exe.config b/RecurseWindowTest/bin/Debug/RecurseWindowTest.exe.config new file mode 100644 index 0000000..5754728 --- /dev/null +++ b/RecurseWindowTest/bin/Debug/RecurseWindowTest.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/RecurseWindowTest/bin/Debug/RecurseWindowTest.pdb b/RecurseWindowTest/bin/Debug/RecurseWindowTest.pdb new file mode 100644 index 0000000..fc8a84c Binary files /dev/null and b/RecurseWindowTest/bin/Debug/RecurseWindowTest.pdb differ diff --git a/RecurseWindowTest/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/RecurseWindowTest/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..ea28b15 Binary files /dev/null and b/RecurseWindowTest/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/RecurseWindowTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/RecurseWindowTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..2754265 Binary files /dev/null and b/RecurseWindowTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/RecurseWindowTest/obj/Debug/RecurseWindowTest.Form1.resources b/RecurseWindowTest/obj/Debug/RecurseWindowTest.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/RecurseWindowTest/obj/Debug/RecurseWindowTest.Form1.resources differ diff --git a/RecurseWindowTest/obj/Debug/RecurseWindowTest.Properties.Resources.resources b/RecurseWindowTest/obj/Debug/RecurseWindowTest.Properties.Resources.resources new file mode 100644 index 0000000..117573f Binary files /dev/null and b/RecurseWindowTest/obj/Debug/RecurseWindowTest.Properties.Resources.resources differ diff --git a/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.CoreCompileInputs.cache b/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..bfe380c --- /dev/null +++ b/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +8069502011d0681850e57a53d5a1673222f430a6 diff --git a/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.FileListAbsolute.txt b/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..626f132 --- /dev/null +++ b/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.FileListAbsolute.txt @@ -0,0 +1,10 @@ +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\bin\Debug\RecurseWindowTest.exe.config +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\bin\Debug\RecurseWindowTest.exe +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\bin\Debug\RecurseWindowTest.pdb +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\obj\Debug\RecurseWindowTest.csprojAssemblyReference.cache +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\obj\Debug\RecurseWindowTest.Form1.resources +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\obj\Debug\RecurseWindowTest.Properties.Resources.resources +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\obj\Debug\RecurseWindowTest.csproj.GenerateResource.cache +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\obj\Debug\RecurseWindowTest.csproj.CoreCompileInputs.cache +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\obj\Debug\RecurseWindowTest.exe +C:\Users\achec\source\repos\RecurseWindowTest\RecurseWindowTest\obj\Debug\RecurseWindowTest.pdb diff --git a/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.GenerateResource.cache b/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.GenerateResource.cache new file mode 100644 index 0000000..af7fd39 Binary files /dev/null and b/RecurseWindowTest/obj/Debug/RecurseWindowTest.csproj.GenerateResource.cache differ diff --git a/RecurseWindowTest/obj/Debug/RecurseWindowTest.csprojAssemblyReference.cache b/RecurseWindowTest/obj/Debug/RecurseWindowTest.csprojAssemblyReference.cache new file mode 100644 index 0000000..f81aff4 Binary files /dev/null and b/RecurseWindowTest/obj/Debug/RecurseWindowTest.csprojAssemblyReference.cache differ diff --git a/RecurseWindowTest/obj/Debug/RecurseWindowTest.exe b/RecurseWindowTest/obj/Debug/RecurseWindowTest.exe new file mode 100644 index 0000000..00d40b1 Binary files /dev/null and b/RecurseWindowTest/obj/Debug/RecurseWindowTest.exe differ diff --git a/RecurseWindowTest/obj/Debug/RecurseWindowTest.pdb b/RecurseWindowTest/obj/Debug/RecurseWindowTest.pdb new file mode 100644 index 0000000..fc8a84c Binary files /dev/null and b/RecurseWindowTest/obj/Debug/RecurseWindowTest.pdb differ diff --git a/RecurseWindowTest/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/RecurseWindowTest/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll new file mode 100644 index 0000000..53b8470 Binary files /dev/null and b/RecurseWindowTest/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ