Projekt neu angelegt.

This commit is contained in:
Eugen Höglinger 2020-02-26 15:17:55 +01:00
commit 5a26d92728
34 changed files with 1230 additions and 0 deletions

32
.gitignore vendored Normal file
View File

@ -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/

25
Test_Form.sln Normal file
View File

@ -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

6
Test_Form/App.config Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>

BIN
Test_Form/Construction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
Test_Form/Email.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
Test_Form/Error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

103
Test_Form/Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,103 @@
namespace Test_Form
{
partial class Form1
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
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;
}
}

184
Test_Form/Form1.cs Normal file
View File

@ -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);
}
/// <summary>
/// Stores the current window size.
/// </summary>
private Window.Size CurrentWindowsSize { set; get; } //Speichert die aktuelle Fenstergröße
/// <summary>
/// Stores the current control box setting.
/// </summary>
private Window.ControlBox CurrentControlBox { set; get; } //Speichert die aktuelle ControllBox Einstellung
/// <summary>
/// Stores the current border sizeable setting.
/// </summary>
private Window.BorderStyle CurrentBorderStyle { set; get; } //Speichert die Größen-Einstellbarkeit
/// <summary>
/// Stores the windows most on top setting.
/// </summary>
private Window.TopMost CurrentTopMost { set; get; } //Speichert die Fenster meistens oben Einstellung
/// <summary>
/// Stores the current icon image
/// </summary>
private Bitmap CurrentIconImage { set; get; } //Speichert das aktuelle Icon
/// <summary>
/// Sets the appearance of the window.
/// </summary>
/// <param name="winSize">A valid window size. Possible options are: 'Nano' (360x270), 'Micro' (480x360), 'Mini' (640x480), 'Midi' (850x640), 'Maxi' (1020x770) and 'Magnum' (1360x1020).</param>
/// <param name="ctrlBox">A valid control box status value. Possible options are: 'Off' and 'On'.</param>
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;
}
}
/// <summary>
/// Sets one of ten different Icons.
/// </summary>
/// <param name="icon">A valid icon. Possible options are: 'Construction', 'Email', 'Error', 'FatalError', 'Information', 'Instruction', 'Question', 'Telephone', 'Tips', 'Warning'.</param>
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)
{
}
}
}

120
Test_Form/Form1.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

99
Test_Form/Icons.cs Normal file
View File

@ -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
{
/// <summary>
/// Control the possible icons.
/// </summary>
public Icons()
{
SetIcon(Icon.Information); //Initialisiere ein Icon
}
//Die vorhandenen Icons
public enum Icon
{
Construction,
Email,
Error,
FatalError,
Information,
Instruction,
Question,
Telephon,
Tips,
Warning
}
/// <summary>
/// Stores the current icon.
/// </summary>
public Icon CurrentIcon { private set; get; }
/// <summary>
/// Stores the current icon image.
/// </summary>
public Bitmap CurrentIconImage { private set; get; }
/// <summary>
/// Sets the used icon.
/// </summary>
/// <param name="icon">A valid icon. Possible options are: 'Construction', 'Email', 'Error', 'FatalError', 'Information', 'Instruction', 'Question', 'Telephone', 'Tips', 'Warning'.</param>
/// <returns>Returns the image name.</returns>
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;
}
}
}

BIN
Test_Form/Information.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
Test_Form/Instruction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

22
Test_Form/Program.cs Normal file
View File

@ -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
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -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")]

163
Test_Form/Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,163 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Test_Form.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// 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() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[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;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Construction {
get {
object obj = ResourceManager.GetObject("Construction", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Email {
get {
object obj = ResourceManager.GetObject("Email", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Error {
get {
object obj = ResourceManager.GetObject("Error", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap FatalError {
get {
object obj = ResourceManager.GetObject("FatalError", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Information {
get {
object obj = ResourceManager.GetObject("Information", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Instruction {
get {
object obj = ResourceManager.GetObject("Instruction", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Question {
get {
object obj = ResourceManager.GetObject("Question", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Telephone {
get {
object obj = ResourceManager.GetObject("Telephone", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tips {
get {
object obj = ResourceManager.GetObject("Tips", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Warning {
get {
object obj = ResourceManager.GetObject("Warning", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Construction" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Construction.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Email" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Email.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Error" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FatalError" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FatalError.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Information" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Information.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Instruction" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Instruction.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Question" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Question.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Telephone" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Telephone.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tips" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Tips.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Warning" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Warning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

BIN
Test_Form/Question.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
Test_Form/Telephone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3F1546F7-04CE-4464-8987-0DDDD4424C2C}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Test_Form</RootNamespace>
<AssemblyName>Test_Form</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Icons.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Window.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Resources\FatalError.png" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="Resources\Construction.png" />
<EmbeddedResource Include="Resources\Email.png" />
<EmbeddedResource Include="Resources\Error.png" />
<EmbeddedResource Include="Resources\Information.png" />
<EmbeddedResource Include="Resources\Instruction.png" />
<EmbeddedResource Include="Resources\Question.png" />
<EmbeddedResource Include="Resources\Telephone.png" />
<EmbeddedResource Include="Resources\Tips.png" />
<EmbeddedResource Include="Resources\Warning.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

BIN
Test_Form/Tips.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
Test_Form/Warning.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

153
Test_Form/Window.cs Normal file
View File

@ -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
{
/// <summary>
/// Controls the appearance of a window.
/// </summary>
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
}
/// <summary>
/// Stores the current window size.
/// </summary>
public Size CurrentWindowSize { private set; get; }
/// <summary>
/// Stores the size values of the current window.
/// </summary>
public int[] CurrentWindowSizeValue { private set; get; }
/// <summary>
/// Stores the current control box setting.
/// </summary>
public ControlBox CurrentControlBox { private set; get; }
/// <summary>
/// Stores the border sizeable setting.
/// </summary>
public BorderStyle CurrentBorderStyle { private set; get; }
/// <summary>
/// Stores the window most on top setting.
/// </summary>
public TopMost CurrentTopMostStatus { private set; get; }
/// <summary>
/// Sets the widht and height size of a window.
/// </summary>
/// <param name="size">A valid window size. Possible options are: 'Nano' (360x270), 'Micro' (480x360), 'Mini' (640x480), 'Midi' (850x640), 'Maxi' (1020x770) und 'Magnum' (1360x1020).</param>
/// <returns>Returns the widht and height value of the window.</returns>
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;
}
/// <summary>
/// Sets the controlbox of a window.
/// </summary>
/// <param name="controlBox">A valid option. Possible options are 'Off' and 'On'.</param>
/// <returns>Returns the control box status.</returns>
public Window.ControlBox SetControlBox(ControlBox controlBox)
{
CurrentControlBox = controlBox;
return controlBox;
}
/// <summary>
/// Sets the border style of a window.
/// </summary>
/// <param name="borderStyle">A valid option. Possible options are 'Fix' and 'Sizeable'.</param>
/// <returns>Returns the control box status.</returns>
public Window.BorderStyle SetBorderStyle(BorderStyle borderStyle)
{
CurrentBorderStyle = borderStyle;
return borderStyle;
}
/// <summary>
/// Sets whether the window is most on top.
/// </summary>
/// <param name="topMost">A valid option. Possible options are 'Off' and 'On'.</param>
/// <returns>Returns the most on top status.</returns>
public Window.TopMost SetTopMost(TopMost topMost)
{
CurrentTopMostStatus = topMost;
return topMost;
}
}
}