commit 5a26d927283f3ebea73b3c4854780b54b4e9f074 Author: Eugen Höglinger Date: Wed Feb 26 15:17:55 2020 +0100 Projekt neu angelegt. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a5f80a --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ + +#Ignore thumbnails created by Windows +Thumbs.db +#Ignore files built by Visual Studio +*.obj +*.exe +*.pdb +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug*/ +*.lib +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +[Tt]est[Rr]esult* +.vs/ +#Nuget packages folder +packages/ diff --git a/Test_Form.sln b/Test_Form.sln new file mode 100644 index 0000000..464bc27 --- /dev/null +++ b/Test_Form.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2036 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_Form", "Test_Form\Test_Form.csproj", "{3F1546F7-04CE-4464-8987-0DDDD4424C2C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3F1546F7-04CE-4464-8987-0DDDD4424C2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F1546F7-04CE-4464-8987-0DDDD4424C2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F1546F7-04CE-4464-8987-0DDDD4424C2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F1546F7-04CE-4464-8987-0DDDD4424C2C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6619D5B7-52FB-4C1E-8E03-EFD1912D864F} + EndGlobalSection +EndGlobal diff --git a/Test_Form/App.config b/Test_Form/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/Test_Form/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Test_Form/Construction.png b/Test_Form/Construction.png new file mode 100644 index 0000000..0914ebc Binary files /dev/null and b/Test_Form/Construction.png differ diff --git a/Test_Form/Email.png b/Test_Form/Email.png new file mode 100644 index 0000000..6224ae0 Binary files /dev/null and b/Test_Form/Email.png differ diff --git a/Test_Form/Error.png b/Test_Form/Error.png new file mode 100644 index 0000000..500eb96 Binary files /dev/null and b/Test_Form/Error.png differ diff --git a/Test_Form/Form1.Designer.cs b/Test_Form/Form1.Designer.cs new file mode 100644 index 0000000..fae2ff7 --- /dev/null +++ b/Test_Form/Form1.Designer.cs @@ -0,0 +1,103 @@ +namespace Test_Form +{ + partial class Form1 + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.buttonLeft = new System.Windows.Forms.Button(); + this.pictureBoxIcon = new System.Windows.Forms.PictureBox(); + this.buttonRight = new System.Windows.Forms.Button(); + this.buttonCenter = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxIcon)).BeginInit(); + this.SuspendLayout(); + // + // buttonLeft + // + this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonLeft.Location = new System.Drawing.Point(12, 204); + this.buttonLeft.Name = "buttonLeft"; + this.buttonLeft.Size = new System.Drawing.Size(75, 23); + this.buttonLeft.TabIndex = 0; + this.buttonLeft.Text = "Change Size"; + this.buttonLeft.UseVisualStyleBackColor = true; + this.buttonLeft.Click += new System.EventHandler(this.buttonChangeSize_Click); + // + // pictureBoxIcon + // + this.pictureBoxIcon.Location = new System.Drawing.Point(20, 20); + this.pictureBoxIcon.Name = "pictureBoxIcon"; + this.pictureBoxIcon.Size = new System.Drawing.Size(32, 32); + this.pictureBoxIcon.TabIndex = 1; + this.pictureBoxIcon.TabStop = false; + // + // buttonRight + // + this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRight.Location = new System.Drawing.Point(265, 204); + this.buttonRight.Name = "buttonRight"; + this.buttonRight.Size = new System.Drawing.Size(75, 23); + this.buttonRight.TabIndex = 2; + this.buttonRight.Text = "Button3"; + this.buttonRight.UseVisualStyleBackColor = true; + this.buttonRight.Click += new System.EventHandler(this.buttonRight_Click); + // + // buttonCenter + // + this.buttonCenter.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.buttonCenter.Location = new System.Drawing.Point(139, 204); + this.buttonCenter.Name = "buttonCenter"; + this.buttonCenter.Size = new System.Drawing.Size(75, 23); + this.buttonCenter.TabIndex = 3; + this.buttonCenter.Text = "Button2"; + this.buttonCenter.UseVisualStyleBackColor = true; + this.buttonCenter.Click += new System.EventHandler(this.buttonCenter_Click); + // + // Form1 + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(352, 239); + this.Controls.Add(this.buttonCenter); + this.Controls.Add(this.buttonRight); + this.Controls.Add(this.pictureBoxIcon); + this.Controls.Add(this.buttonLeft); + this.Name = "Form1"; + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxIcon)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonLeft; + private System.Windows.Forms.PictureBox pictureBoxIcon; + private System.Windows.Forms.Button buttonRight; + private System.Windows.Forms.Button buttonCenter; + } +} + diff --git a/Test_Form/Form1.cs b/Test_Form/Form1.cs new file mode 100644 index 0000000..a1aa29b --- /dev/null +++ b/Test_Form/Form1.cs @@ -0,0 +1,184 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Test_Form +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + //Anfängliche Fensteraussehen initialisieren + string btnLeft = "Left"; + string btnCenter = "Center"; + string btnRight = "Right"; + SetWindowAppearance(Window.Size.Micro, Window.ControlBox.On, Window.BorderStyle.Sizeable, Window.TopMost.Off, btnLeft, btnCenter, btnRight); + + //Anfängliches Icon initialisieren + SetIconImage(Icons.Icon.Information); + } + + /// + /// Stores the current window size. + /// + private Window.Size CurrentWindowsSize { set; get; } //Speichert die aktuelle Fenstergröße + + /// + /// Stores the current control box setting. + /// + private Window.ControlBox CurrentControlBox { set; get; } //Speichert die aktuelle ControllBox Einstellung + + /// + /// Stores the current border sizeable setting. + /// + private Window.BorderStyle CurrentBorderStyle { set; get; } //Speichert die Größen-Einstellbarkeit + + /// + /// Stores the windows most on top setting. + /// + private Window.TopMost CurrentTopMost { set; get; } //Speichert die Fenster meistens oben Einstellung + + /// + /// Stores the current icon image + /// + private Bitmap CurrentIconImage { set; get; } //Speichert das aktuelle Icon + + /// + /// Sets the appearance of the window. + /// + /// A valid window size. Possible options are: 'Nano' (360x270), 'Micro' (480x360), 'Mini' (640x480), 'Midi' (850x640), 'Maxi' (1020x770) and 'Magnum' (1360x1020). + /// A valid control box status value. Possible options are: 'Off' and 'On'. + private void SetWindowAppearance(Window.Size winSize, Window.ControlBox ctrlBox, Window.BorderStyle borderStyle, Window.TopMost topMost, string btnLeft, string btnCenter, string btnRight) + { + var window = new Window(); + + //Fenstergröße setzen + window.SetWindowSize(winSize); + this.Size = new Size(window.CurrentWindowSizeValue[0], window.CurrentWindowSizeValue[1]); + CurrentWindowsSize = winSize; + + //Control Box setzen + CurrentControlBox = window.SetControlBox(ctrlBox); + this.ControlBox = Convert.ToBoolean(CurrentControlBox); + + //Border Style setzen + CurrentBorderStyle = window.SetBorderStyle(borderStyle); + this.FormBorderStyle = (FormBorderStyle)CurrentBorderStyle; + + //Fenster immer oben auf + CurrentTopMost = window.SetTopMost(topMost); + this.TopMost = Convert.ToBoolean(CurrentTopMost); + + //Button links + if (btnLeft == "") + { + buttonLeft.Enabled = false; + buttonLeft.Visible = false; + } + else + { + buttonLeft.Enabled = true; + buttonLeft.Visible = true; + buttonLeft.Text = btnLeft; + } + + //Button mitte + if (btnCenter == "") + { + buttonCenter.Enabled = false; + buttonCenter.Visible = false; + } + else + { + int x = (int) window.CurrentWindowSizeValue[0] / 2 - 41; + int y = window.CurrentWindowSizeValue[1] - 66; + buttonCenter.Location = new System.Drawing.Point(x, y); + buttonCenter.Enabled = true; + buttonCenter.Visible = true; + buttonCenter.Text = btnCenter; + } + + //Button rechts + if (btnRight == "") + { + buttonRight.Enabled = false; + buttonRight.Visible = false; + } + else + { + buttonRight.Enabled = true; + buttonRight.Visible = true; + buttonRight.Text = btnRight; + } + } + + /// + /// Sets one of ten different Icons. + /// + /// A valid icon. Possible options are: 'Construction', 'Email', 'Error', 'FatalError', 'Information', 'Instruction', 'Question', 'Telephone', 'Tips', 'Warning'. + private void SetIconImage(Icons.Icon icon) + { + var icons = new Icons(); + Bitmap bmp = icons.SetIcon(icon); + pictureBoxIcon.Image = bmp; + CurrentIconImage = bmp; + } + + private void buttonChangeSize_Click(object sender, EventArgs e) + { + //Die Tasten-Texte definieren + string btnLeft = "Change Size"; + string btnCenter = "Center"; + string btnRight = "Right"; + + //Alle möglichen Auflösungen der Reihe nach durchschalten + if (CurrentWindowsSize == Window.Size.Nano) + { + SetWindowAppearance(Window.Size.Micro, CurrentControlBox, CurrentBorderStyle, CurrentTopMost, btnLeft, btnCenter, btnRight); + } + else if (CurrentWindowsSize == Window.Size.Micro) + { + SetWindowAppearance(Window.Size.Mini, CurrentControlBox, CurrentBorderStyle, CurrentTopMost, btnLeft, btnCenter, btnRight); + } + else if (CurrentWindowsSize == Window.Size.Mini) + { + SetWindowAppearance(Window.Size.Midi, CurrentControlBox, CurrentBorderStyle, CurrentTopMost, btnLeft, btnCenter, btnRight); + } + else if (CurrentWindowsSize == Window.Size.Midi) + { + SetWindowAppearance(Window.Size.Maxi, CurrentControlBox, CurrentBorderStyle, CurrentTopMost, btnLeft, btnCenter, btnRight); + } + else if (CurrentWindowsSize == Window.Size.Maxi) + { + SetWindowAppearance(Window.Size.Magnum, CurrentControlBox, CurrentBorderStyle, CurrentTopMost, btnLeft, btnCenter, btnRight); + } + else + { + SetWindowAppearance(Window.Size.Nano, CurrentControlBox, CurrentBorderStyle, CurrentTopMost, btnLeft, btnCenter, btnRight); + } + } + + private void buttonCenter_Click(object sender, EventArgs e) + { + + } + + private void buttonRight_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/Test_Form/Form1.resx b/Test_Form/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Test_Form/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/Test_Form/Icons.cs b/Test_Form/Icons.cs new file mode 100644 index 0000000..1e9f57a --- /dev/null +++ b/Test_Form/Icons.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Test_Form +{ + class Icons + { + /// + /// Control the possible icons. + /// + public Icons() + { + SetIcon(Icon.Information); //Initialisiere ein Icon + } + + //Die vorhandenen Icons + public enum Icon + { + Construction, + Email, + Error, + FatalError, + Information, + Instruction, + Question, + Telephon, + Tips, + Warning + } + + /// + /// Stores the current icon. + /// + public Icon CurrentIcon { private set; get; } + + /// + /// Stores the current icon image. + /// + public Bitmap CurrentIconImage { private set; get; } + + /// + /// Sets the used icon. + /// + /// A valid icon. Possible options are: 'Construction', 'Email', 'Error', 'FatalError', 'Information', 'Instruction', 'Question', 'Telephone', 'Tips', 'Warning'. + /// Returns the image name. + public Bitmap SetIcon(Icon icon) + { + switch (icon) + { + case Icon.Construction: + CurrentIconImage = GetIconImage("Test_Form.Resources.Construction.png"); + break; + case Icon.Email: + CurrentIconImage = GetIconImage("Test_Form.Resources.Email.png"); + break; + case Icon.Error: + CurrentIconImage = GetIconImage("Test_Form.Resources.Error.png"); + break; + case Icon.FatalError: + CurrentIconImage = GetIconImage("Test_Form.Resources.FatalError.png"); + break; + case Icon.Instruction: + CurrentIconImage = GetIconImage("Test_Form.Resources.Instruction.png"); + break; + case Icon.Question: + CurrentIconImage = GetIconImage("Test_Form.Resources.Question.png"); + break; + case Icon.Telephon: + CurrentIconImage = GetIconImage("Test_Form.Resources.Telephon.png"); + break; + case Icon.Tips: + CurrentIconImage = GetIconImage("Test_Form.Resources.Tips.png"); + break; + case Icon.Warning: + CurrentIconImage = GetIconImage("Test_Form.Resources.Warning.png"); + break; + default: + CurrentIconImage = GetIconImage("Test_Form.Resources.Information.png"); + break; + } + CurrentIcon = icon; + return CurrentIconImage; + } + + private Bitmap GetIconImage(string icon) + { + Assembly myAssembly = Assembly.GetExecutingAssembly(); + Stream myStream = myAssembly.GetManifestResourceStream(icon); + Bitmap bmp = new Bitmap(myStream); + return bmp; + } + } +} diff --git a/Test_Form/Information.png b/Test_Form/Information.png new file mode 100644 index 0000000..6c532b2 Binary files /dev/null and b/Test_Form/Information.png differ diff --git a/Test_Form/Instruction.png b/Test_Form/Instruction.png new file mode 100644 index 0000000..844188f Binary files /dev/null and b/Test_Form/Instruction.png differ diff --git a/Test_Form/Program.cs b/Test_Form/Program.cs new file mode 100644 index 0000000..80b1571 --- /dev/null +++ b/Test_Form/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Test_Form +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Test_Form/Properties/AssemblyInfo.cs b/Test_Form/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..38f4d85 --- /dev/null +++ b/Test_Form/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("Test_Form")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Test_Form")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("3f1546f7-04ce-4464-8987-0dddd4424c2c")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Test_Form/Properties/Resources.Designer.cs b/Test_Form/Properties/Resources.Designer.cs new file mode 100644 index 0000000..d800089 --- /dev/null +++ b/Test_Form/Properties/Resources.Designer.cs @@ -0,0 +1,163 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Test_Form.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [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("Test_Form.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Construction { + get { + object obj = ResourceManager.GetObject("Construction", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Email { + get { + object obj = ResourceManager.GetObject("Email", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Error { + get { + object obj = ResourceManager.GetObject("Error", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap FatalError { + get { + object obj = ResourceManager.GetObject("FatalError", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Information { + get { + object obj = ResourceManager.GetObject("Information", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Instruction { + get { + object obj = ResourceManager.GetObject("Instruction", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Question { + get { + object obj = ResourceManager.GetObject("Question", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Telephone { + get { + object obj = ResourceManager.GetObject("Telephone", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Tips { + get { + object obj = ResourceManager.GetObject("Tips", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Warning { + get { + object obj = ResourceManager.GetObject("Warning", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Test_Form/Properties/Resources.resx b/Test_Form/Properties/Resources.resx new file mode 100644 index 0000000..dd6c49c --- /dev/null +++ b/Test_Form/Properties/Resources.resx @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\Construction.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Email.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\FatalError.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Information.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Instruction.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Question.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Telephone.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Tips.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Warning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Test_Form/Properties/Settings.Designer.cs b/Test_Form/Properties/Settings.Designer.cs new file mode 100644 index 0000000..63caa7e --- /dev/null +++ b/Test_Form/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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 Test_Form.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/Test_Form/Properties/Settings.settings b/Test_Form/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Test_Form/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Test_Form/Question.png b/Test_Form/Question.png new file mode 100644 index 0000000..edfb8bd Binary files /dev/null and b/Test_Form/Question.png differ diff --git a/Test_Form/Resources/Construction.png b/Test_Form/Resources/Construction.png new file mode 100644 index 0000000..0914ebc Binary files /dev/null and b/Test_Form/Resources/Construction.png differ diff --git a/Test_Form/Resources/Email.png b/Test_Form/Resources/Email.png new file mode 100644 index 0000000..6224ae0 Binary files /dev/null and b/Test_Form/Resources/Email.png differ diff --git a/Test_Form/Resources/Error.png b/Test_Form/Resources/Error.png new file mode 100644 index 0000000..500eb96 Binary files /dev/null and b/Test_Form/Resources/Error.png differ diff --git a/Test_Form/Resources/FatalError.png b/Test_Form/Resources/FatalError.png new file mode 100644 index 0000000..17de198 Binary files /dev/null and b/Test_Form/Resources/FatalError.png differ diff --git a/Test_Form/Resources/Information.png b/Test_Form/Resources/Information.png new file mode 100644 index 0000000..6c532b2 Binary files /dev/null and b/Test_Form/Resources/Information.png differ diff --git a/Test_Form/Resources/Instruction.png b/Test_Form/Resources/Instruction.png new file mode 100644 index 0000000..844188f Binary files /dev/null and b/Test_Form/Resources/Instruction.png differ diff --git a/Test_Form/Resources/Question.png b/Test_Form/Resources/Question.png new file mode 100644 index 0000000..edfb8bd Binary files /dev/null and b/Test_Form/Resources/Question.png differ diff --git a/Test_Form/Resources/Telephone.png b/Test_Form/Resources/Telephone.png new file mode 100644 index 0000000..31327bb Binary files /dev/null and b/Test_Form/Resources/Telephone.png differ diff --git a/Test_Form/Resources/Tips.png b/Test_Form/Resources/Tips.png new file mode 100644 index 0000000..a42695d Binary files /dev/null and b/Test_Form/Resources/Tips.png differ diff --git a/Test_Form/Resources/Warning.png b/Test_Form/Resources/Warning.png new file mode 100644 index 0000000..dd4990d Binary files /dev/null and b/Test_Form/Resources/Warning.png differ diff --git a/Test_Form/Telephone.png b/Test_Form/Telephone.png new file mode 100644 index 0000000..31327bb Binary files /dev/null and b/Test_Form/Telephone.png differ diff --git a/Test_Form/Test_Form.csproj b/Test_Form/Test_Form.csproj new file mode 100644 index 0000000..b0ac1eb --- /dev/null +++ b/Test_Form/Test_Form.csproj @@ -0,0 +1,99 @@ + + + + + Debug + AnyCPU + {3F1546F7-04CE-4464-8987-0DDDD4424C2C} + WinExe + Test_Form + Test_Form + v4.6.1 + 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/Test_Form/Tips.png b/Test_Form/Tips.png new file mode 100644 index 0000000..a42695d Binary files /dev/null and b/Test_Form/Tips.png differ diff --git a/Test_Form/Warning.png b/Test_Form/Warning.png new file mode 100644 index 0000000..dd4990d Binary files /dev/null and b/Test_Form/Warning.png differ diff --git a/Test_Form/Window.cs b/Test_Form/Window.cs new file mode 100644 index 0000000..e58206c --- /dev/null +++ b/Test_Form/Window.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Test_Form +{ + class Window + { + /// + /// Controls the appearance of a window. + /// + public Window() + { + SetWindowSize(Size.Micro); //Initialisiere ein Fenster + } + + public enum Size + { + Nano, + Micro, + Mini, + Midi, + Maxi, + Magnum + } + + public enum ControlBox + { + Off, + On + } + + public enum BorderStyle + { + Fix, + Sizeable + } + + public enum TopMost + { + Off, + On + } + + /// + /// Stores the current window size. + /// + public Size CurrentWindowSize { private set; get; } + + /// + /// Stores the size values of the current window. + /// + public int[] CurrentWindowSizeValue { private set; get; } + + /// + /// Stores the current control box setting. + /// + public ControlBox CurrentControlBox { private set; get; } + + /// + /// Stores the border sizeable setting. + /// + public BorderStyle CurrentBorderStyle { private set; get; } + + /// + /// Stores the window most on top setting. + /// + public TopMost CurrentTopMostStatus { private set; get; } + + /// + /// Sets the widht and height size of a window. + /// + /// A valid window size. Possible options are: 'Nano' (360x270), 'Micro' (480x360), 'Mini' (640x480), 'Midi' (850x640), 'Maxi' (1020x770) und 'Magnum' (1360x1020). + /// Returns the widht and height value of the window. + public int[] SetWindowSize(Size size) + { + int[] windowsSize = new int[2]; + switch (size) + { + case Size.Nano: + windowsSize[0] = 360; + windowsSize[1] = 270; + break; + case Size.Micro: + windowsSize[0] = 480; + windowsSize[1] = 360; + break; + case Size.Mini: + windowsSize[0] = 640; + windowsSize[1] = 480; + break; + case Size.Midi: + windowsSize[0] = 850; + windowsSize[1] = 640; + break; + case Size.Maxi: + windowsSize[0] = 1020; + windowsSize[1] = 770; + break; + case Size.Magnum: + windowsSize[0] = 1360; + windowsSize[1] = 1020; + break; + default: + windowsSize[0] = 480; + windowsSize[1] = 360; + break; //Size.Micro + } + CurrentWindowSize = size; + CurrentWindowSizeValue = windowsSize; + + return CurrentWindowSizeValue; + } + + /// + /// Sets the controlbox of a window. + /// + /// A valid option. Possible options are 'Off' and 'On'. + /// Returns the control box status. + public Window.ControlBox SetControlBox(ControlBox controlBox) + { + CurrentControlBox = controlBox; + + return controlBox; + } + + /// + /// Sets the border style of a window. + /// + /// A valid option. Possible options are 'Fix' and 'Sizeable'. + /// Returns the control box status. + public Window.BorderStyle SetBorderStyle(BorderStyle borderStyle) + { + CurrentBorderStyle = borderStyle; + + return borderStyle; + } + + /// + /// Sets whether the window is most on top. + /// + /// A valid option. Possible options are 'Off' and 'On'. + /// Returns the most on top status. + public Window.TopMost SetTopMost(TopMost topMost) + { + CurrentTopMostStatus = topMost; + + return topMost; + } + } +}