commit 771dae7e6dbe3a6fda1ddb79786dbf8f6a8be426 Author: Eugen Höglinger Date: Wed Feb 26 15:19:26 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/MyForm/App.config b/MyForm/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/MyForm/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/MyForm/Icons.cs b/MyForm/Icons.cs new file mode 100644 index 0000000..55202c9 --- /dev/null +++ b/MyForm/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 OwnForms +{ + 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/MyForm/MyForm.Designer.cs b/MyForm/MyForm.Designer.cs new file mode 100644 index 0000000..feb1158 --- /dev/null +++ b/MyForm/MyForm.Designer.cs @@ -0,0 +1,75 @@ +namespace OwnForms +{ + partial class MyForm + { + /// + /// 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.labelMyForm = new System.Windows.Forms.Label(); + this.buttonOk = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // labelMyForm + // + this.labelMyForm.AutoSize = true; + this.labelMyForm.Location = new System.Drawing.Point(13, 13); + this.labelMyForm.Name = "labelMyForm"; + this.labelMyForm.Size = new System.Drawing.Size(16, 13); + this.labelMyForm.TabIndex = 0; + this.labelMyForm.Text = "..."; + // + // buttonOk + // + this.buttonOk.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.buttonOk.Location = new System.Drawing.Point(77, 93); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 1; + this.buttonOk.Text = "OK"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click); + // + // MyForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(228, 128); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.labelMyForm); + this.Name = "MyForm"; + this.Text = "MyForm"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label labelMyForm; + private System.Windows.Forms.Button buttonOk; + } +} + diff --git a/MyForm/MyForm.cs b/MyForm/MyForm.cs new file mode 100644 index 0000000..d74c271 --- /dev/null +++ b/MyForm/MyForm.cs @@ -0,0 +1,161 @@ +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 OwnForms +{ + public partial class MyForm : Form + { + #region Version und Copyright + // Version und Copyright + string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen + string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + string copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + string icon = Application.StartupPath + "\\Info.bmp"; + //Assembly Datum und Zeit + static DateTime value = AssemblyDateTime(); + string date = value.ToShortDateString(); + string time = value.ToLongTimeString(); + private static DateTime AssemblyDateTime() + { + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision)); + //Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original) + return buildDateTime; + } + #endregion + + #region Programm-Info + /// + /// Contains the name of the program file + /// + public static string ProgramName { set; get; } + + /// + /// Contains the version of the program file + /// + public static string ProgramVersion { set; get; } + + /// + /// Contains the copyright notice + /// + public static string Copyright { set; get; } + + private void SetProgramInfo() + { + //Name, Version und Copyright setzen + ProgramName = programName; + ProgramVersion = programVersion; + Copyright = copyright; + } + #endregion + + public MyForm() + { + SetProgramInfo(); //Name, Version und Copyright setzen + InitializeComponent(); + + var window = new Window(); + //Fenstergröße setzen + window.SetWindowSize(OwnForms.Window.Size.Nano); + this.Size = new Size(window.CurrentWindowSizeValue[0], window.CurrentWindowSizeValue[1]); + } + + public MyForm(string name) + { + SetProgramInfo(); //Name, Version und Copyright setzen + InitializeComponent(); + + var window = new Window(); + //Fenstergröße setzen + window.SetWindowSize(OwnForms.Window.Size.Nano); + this.Size = new Size(window.CurrentWindowSizeValue[0], window.CurrentWindowSizeValue[1]); + + this.Text = name; + } + + public MyForm(string name, string text) + { + SetProgramInfo(); //Name, Version und Copyright setzen + InitializeComponent(); + + var window = new Window(); + //Fenstergröße setzen + window.SetWindowSize(OwnForms.Window.Size.Nano); + this.Size = new Size(window.CurrentWindowSizeValue[0], window.CurrentWindowSizeValue[1]); + + this.Text = name; + labelMyForm.Text = text; + } + + public MyForm(Window.Size winSize, string name, string text) + { + SetProgramInfo(); //Name, Version und Copyright setzen + InitializeComponent(); + + var window = new Window(); + //Fenstergröße setzen + window.SetWindowSize(winSize); + this.Size = new Size(window.CurrentWindowSizeValue[0], window.CurrentWindowSizeValue[1]); + + this.Text = name; + labelMyForm.Text = text; + } + + private void buttonOk_Click(object sender, EventArgs e) + { + this.Close(); + } + } + + public class OwnMessageBox : Form + { + + } + + public class OwnAboutWindow : Form + { + + } + + public class OwnOutputWinwow : Form + { + + } + + public class OwnForm : Form + { + public static void Show() + { + var mf = new MyForm(); + mf.ShowDialog(); + } + + public static void Show(string name) + { + var mf = new MyForm(name); + mf.ShowDialog(); + } + + public static void Show(string name, string text) + { + var mf = new MyForm(name, text); + mf.ShowDialog(); + } + + public static void Show(Window.Size winSize, string name, string text) + { + var mf = new MyForm(winSize, name, text); + mf.ShowDialog(); + } + } +} diff --git a/MyForm/MyForm.csproj b/MyForm/MyForm.csproj new file mode 100644 index 0000000..c6732dd --- /dev/null +++ b/MyForm/MyForm.csproj @@ -0,0 +1,85 @@ + + + + + Debug + AnyCPU + {339421FA-9E27-48CF-AA66-2134619293A6} + WinExe + MyForm + MyForm + v4.6.1 + 512 + true + false + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + Form + + + MyForm.cs + + + + + + MyForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/MyForm/MyForm.resx b/MyForm/MyForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MyForm/MyForm.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/MyForm/Program.cs b/MyForm/Program.cs new file mode 100644 index 0000000..d305440 --- /dev/null +++ b/MyForm/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace OwnForms +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MyForm()); + } + } +} diff --git a/MyForm/Properties/AssemblyInfo.cs b/MyForm/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e815ad8 --- /dev/null +++ b/MyForm/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("MyForm")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyForm")] +[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("339421fa-9e27-48cf-aa66-2134619293a6")] + +// 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.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MyForm/Properties/Resources.Designer.cs b/MyForm/Properties/Resources.Designer.cs new file mode 100644 index 0000000..75ef2f0 --- /dev/null +++ b/MyForm/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion: 4.0.30319.42000 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + +namespace OwnForms.Properties +{ + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-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 Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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 ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyForm.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, 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; + } + } + } +} diff --git a/MyForm/Properties/Resources.resx b/MyForm/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/MyForm/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MyForm/Properties/Settings.Designer.cs b/MyForm/Properties/Settings.Designer.cs new file mode 100644 index 0000000..22feebe --- /dev/null +++ b/MyForm/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 OwnForms.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/MyForm/Properties/Settings.settings b/MyForm/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/MyForm/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/MyForm/Window.cs b/MyForm/Window.cs new file mode 100644 index 0000000..cccbf93 --- /dev/null +++ b/MyForm/Window.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OwnForms +{ + public 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; + } + } +} diff --git a/Test_Form-Aufruf.sln b/Test_Form-Aufruf.sln new file mode 100644 index 0000000..8148e63 --- /dev/null +++ b/Test_Form-Aufruf.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2050 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_Form-Aufruf", "Test_Form-Aufruf\Test_Form-Aufruf.csproj", "{020CC216-D63B-4177-A37F-7220DA027C1E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyForm", "MyForm\MyForm.csproj", "{339421FA-9E27-48CF-AA66-2134619293A6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {020CC216-D63B-4177-A37F-7220DA027C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {020CC216-D63B-4177-A37F-7220DA027C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {020CC216-D63B-4177-A37F-7220DA027C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {020CC216-D63B-4177-A37F-7220DA027C1E}.Release|Any CPU.Build.0 = Release|Any CPU + {339421FA-9E27-48CF-AA66-2134619293A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {339421FA-9E27-48CF-AA66-2134619293A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {339421FA-9E27-48CF-AA66-2134619293A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {339421FA-9E27-48CF-AA66-2134619293A6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {227FCA5A-7191-4F9A-BE70-CFB7100DE72C} + EndGlobalSection +EndGlobal diff --git a/Test_Form-Aufruf/App.config b/Test_Form-Aufruf/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/Test_Form-Aufruf/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Test_Form-Aufruf/Form1.Designer.cs b/Test_Form-Aufruf/Form1.Designer.cs new file mode 100644 index 0000000..bbd6de9 --- /dev/null +++ b/Test_Form-Aufruf/Form1.Designer.cs @@ -0,0 +1,61 @@ +namespace Test_Form_Aufruf +{ + 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.buttonStart = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // buttonStart + // + this.buttonStart.Location = new System.Drawing.Point(127, 45); + this.buttonStart.Name = "buttonStart"; + this.buttonStart.Size = new System.Drawing.Size(75, 23); + this.buttonStart.TabIndex = 0; + this.buttonStart.Text = "Start"; + this.buttonStart.UseVisualStyleBackColor = true; + this.buttonStart.Click += new System.EventHandler(this.buttonStart_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(328, 80); + this.Controls.Add(this.buttonStart); + this.Name = "Form1"; + this.Text = "Test"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonStart; + } +} + diff --git a/Test_Form-Aufruf/Form1.cs b/Test_Form-Aufruf/Form1.cs new file mode 100644 index 0000000..3edcdad --- /dev/null +++ b/Test_Form-Aufruf/Form1.cs @@ -0,0 +1,77 @@ +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; +using OwnForms; + +namespace Test_Form_Aufruf +{ + public partial class Form1 : Form + { + #region Version und Copyright + // Version und Copyright + string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen + string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + string copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + string icon = Application.StartupPath + "\\Info.bmp"; + //Assembly Datum und Zeit + static DateTime value = AssemblyDateTime(); + string date = value.ToShortDateString(); + string time = value.ToLongTimeString(); + private static DateTime AssemblyDateTime() + { + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision)); + //Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original) + return buildDateTime; + } + #endregion + + #region Programm-Info + /// + /// Contains the name of the program file + /// + public static string ProgramName { set; get; } + + /// + /// Contains the version of the program file + /// + public static string ProgramVersion { set; get; } + + /// + /// Contains the copyright notice + /// + public static string Copyright { set; get; } + + private void SetProgramInfo() + { + //Name, Version und Copyright setzen + ProgramName = programName; + ProgramVersion = programVersion; + Copyright = copyright; + } + #endregion + + public Form1() + { + SetProgramInfo(); //Name, Version und Copyright setzen + InitializeComponent(); + } + + private void buttonStart_Click(object sender, EventArgs e) + { + OwnForm.Show(); + OwnForm.Show("Mein eigener Fenster Name"); + OwnForm.Show("Mein eigener Fenster Name", "Mein eigener Text."); + OwnForm.Show(OwnForms.Window.Size.Midi, "Fenster mit bestimmter Größe", "Die Fenstergröße ist " + OwnForms.Window.Size.Midi.ToString() + "."); + } + } +} diff --git a/Test_Form-Aufruf/Form1.resx b/Test_Form-Aufruf/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Test_Form-Aufruf/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-Aufruf/Program.cs b/Test_Form-Aufruf/Program.cs new file mode 100644 index 0000000..634376e --- /dev/null +++ b/Test_Form-Aufruf/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_Aufruf +{ + 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-Aufruf/Properties/AssemblyInfo.cs b/Test_Form-Aufruf/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1281b83 --- /dev/null +++ b/Test_Form-Aufruf/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-Aufruf")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Test_Form-Aufruf")] +[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("020cc216-d63b-4177-a37f-7220da027c1e")] + +// 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.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Test_Form-Aufruf/Properties/Resources.Designer.cs b/Test_Form-Aufruf/Properties/Resources.Designer.cs new file mode 100644 index 0000000..d379126 --- /dev/null +++ b/Test_Form-Aufruf/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion: 4.0.30319.42000 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Test_Form_Aufruf.Properties +{ + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-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 Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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 ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test_Form_Aufruf.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, 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; + } + } + } +} diff --git a/Test_Form-Aufruf/Properties/Resources.resx b/Test_Form-Aufruf/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Test_Form-Aufruf/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Test_Form-Aufruf/Properties/Settings.Designer.cs b/Test_Form-Aufruf/Properties/Settings.Designer.cs new file mode 100644 index 0000000..abd8129 --- /dev/null +++ b/Test_Form-Aufruf/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_Aufruf.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-Aufruf/Properties/Settings.settings b/Test_Form-Aufruf/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Test_Form-Aufruf/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Test_Form-Aufruf/Test_Form-Aufruf.csproj b/Test_Form-Aufruf/Test_Form-Aufruf.csproj new file mode 100644 index 0000000..22b656b --- /dev/null +++ b/Test_Form-Aufruf/Test_Form-Aufruf.csproj @@ -0,0 +1,89 @@ + + + + + Debug + AnyCPU + {020CC216-D63B-4177-A37F-7220DA027C1E} + WinExe + Test_Form_Aufruf + Test_Form-Aufruf + v4.6.1 + 512 + true + false + + + 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 + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {339421fa-9e27-48cf-aa66-2134619293a6} + MyForm + + + + \ No newline at end of file