From 430f781134b33030a8436de24111629c002a85d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eugen=20H=C3=B6glinger?= Date: Wed, 26 Feb 2020 15:18:32 +0100 Subject: [PATCH] Projekt neu angelegt. --- .gitignore | 32 +++++ Test_Form_Vererbung.sln | 25 ++++ Test_Form_Vererbung/App.config | 6 + Test_Form_Vererbung/BaseForm.Designer.cs | 73 +++++++++++ Test_Form_Vererbung/BaseForm.cs | 35 +++++ Test_Form_Vererbung/BaseForm.resx | 120 ++++++++++++++++++ Test_Form_Vererbung/Form1.Designer.cs | 61 +++++++++ Test_Form_Vererbung/Form1.cs | 31 +++++ Test_Form_Vererbung/Form1.resx | 120 ++++++++++++++++++ Test_Form_Vererbung/MyForm.Designer.cs | 36 ++++++ Test_Form_Vererbung/MyForm.cs | 23 ++++ Test_Form_Vererbung/Program.cs | 22 ++++ .../Properties/AssemblyInfo.cs | 36 ++++++ .../Properties/Resources.Designer.cs | 71 +++++++++++ Test_Form_Vererbung/Properties/Resources.resx | 117 +++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Properties/Settings.settings | 7 + .../Test_Form_Vererbung.csproj | 98 ++++++++++++++ 18 files changed, 943 insertions(+) create mode 100644 .gitignore create mode 100644 Test_Form_Vererbung.sln create mode 100644 Test_Form_Vererbung/App.config create mode 100644 Test_Form_Vererbung/BaseForm.Designer.cs create mode 100644 Test_Form_Vererbung/BaseForm.cs create mode 100644 Test_Form_Vererbung/BaseForm.resx create mode 100644 Test_Form_Vererbung/Form1.Designer.cs create mode 100644 Test_Form_Vererbung/Form1.cs create mode 100644 Test_Form_Vererbung/Form1.resx create mode 100644 Test_Form_Vererbung/MyForm.Designer.cs create mode 100644 Test_Form_Vererbung/MyForm.cs create mode 100644 Test_Form_Vererbung/Program.cs create mode 100644 Test_Form_Vererbung/Properties/AssemblyInfo.cs create mode 100644 Test_Form_Vererbung/Properties/Resources.Designer.cs create mode 100644 Test_Form_Vererbung/Properties/Resources.resx create mode 100644 Test_Form_Vererbung/Properties/Settings.Designer.cs create mode 100644 Test_Form_Vererbung/Properties/Settings.settings create mode 100644 Test_Form_Vererbung/Test_Form_Vererbung.csproj 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_Vererbung.sln b/Test_Form_Vererbung.sln new file mode 100644 index 0000000..9a690c1 --- /dev/null +++ b/Test_Form_Vererbung.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_Vererbung", "Test_Form_Vererbung\Test_Form_Vererbung.csproj", "{3353ED83-E328-42E3-8825-C3DBF6C3BAAC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3353ED83-E328-42E3-8825-C3DBF6C3BAAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3353ED83-E328-42E3-8825-C3DBF6C3BAAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3353ED83-E328-42E3-8825-C3DBF6C3BAAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3353ED83-E328-42E3-8825-C3DBF6C3BAAC}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B21ADF75-5AAB-44D2-A712-C4FBDE0EF0A5} + EndGlobalSection +EndGlobal diff --git a/Test_Form_Vererbung/App.config b/Test_Form_Vererbung/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/Test_Form_Vererbung/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Test_Form_Vererbung/BaseForm.Designer.cs b/Test_Form_Vererbung/BaseForm.Designer.cs new file mode 100644 index 0000000..6861ba2 --- /dev/null +++ b/Test_Form_Vererbung/BaseForm.Designer.cs @@ -0,0 +1,73 @@ +namespace Test_Form_Vererbung +{ + partial class BaseForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.buttonClose = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // buttonClose + // + this.buttonClose.Location = new System.Drawing.Point(12, 197); + this.buttonClose.Name = "buttonClose"; + this.buttonClose.Size = new System.Drawing.Size(75, 23); + this.buttonClose.TabIndex = 0; + this.buttonClose.Text = "Schliessen"; + this.buttonClose.UseVisualStyleBackColor = true; + this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(22, 13); + this.label1.TabIndex = 1; + this.label1.Text = "...1"; + // + // BaseForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(398, 232); + this.Controls.Add(this.label1); + this.Controls.Add(this.buttonClose); + this.Name = "BaseForm"; + this.Text = "BaseForm"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonClose; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/Test_Form_Vererbung/BaseForm.cs b/Test_Form_Vererbung/BaseForm.cs new file mode 100644 index 0000000..34862a0 --- /dev/null +++ b/Test_Form_Vererbung/BaseForm.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Test_Form_Vererbung +{ + public partial class BaseForm : Form + { + public BaseForm() + { + InitializeComponent(); + } + + private void buttonClose_Click(object sender, EventArgs e) + { + this.Close(); + } + + public virtual void Appearance() + { + label1.Text = "Text1"; + } + + public virtual void Appearance(string text) + { + label1.Text = text; + } + } +} diff --git a/Test_Form_Vererbung/BaseForm.resx b/Test_Form_Vererbung/BaseForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Test_Form_Vererbung/BaseForm.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_Vererbung/Form1.Designer.cs b/Test_Form_Vererbung/Form1.Designer.cs new file mode 100644 index 0000000..152a73b --- /dev/null +++ b/Test_Form_Vererbung/Form1.Designer.cs @@ -0,0 +1,61 @@ +namespace Test_Form_Vererbung +{ + 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(12, 63); + 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.button1_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(265, 98); + this.Controls.Add(this.buttonStart); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonStart; + } +} + diff --git a/Test_Form_Vererbung/Form1.cs b/Test_Form_Vererbung/Form1.cs new file mode 100644 index 0000000..d7e2735 --- /dev/null +++ b/Test_Form_Vererbung/Form1.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Test_Form_Vererbung +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + BaseForm myBase = new BaseForm(); + myBase.Appearance("Das ist ein Text"); + myBase.Show(); + + MyForm myForm = new MyForm(); + myForm.Appearance(); + myForm.Show(); + } + } +} \ No newline at end of file diff --git a/Test_Form_Vererbung/Form1.resx b/Test_Form_Vererbung/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Test_Form_Vererbung/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_Vererbung/MyForm.Designer.cs b/Test_Form_Vererbung/MyForm.Designer.cs new file mode 100644 index 0000000..fddd493 --- /dev/null +++ b/Test_Form_Vererbung/MyForm.Designer.cs @@ -0,0 +1,36 @@ +namespace Test_Form_Vererbung +{ + 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.components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/Test_Form_Vererbung/MyForm.cs b/Test_Form_Vererbung/MyForm.cs new file mode 100644 index 0000000..459f9d9 --- /dev/null +++ b/Test_Form_Vererbung/MyForm.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Test_Form_Vererbung +{ + public partial class MyForm : Test_Form_Vererbung.BaseForm + { + public MyForm() + { + InitializeComponent(); + + this.Name = "MyForm"; + this.Text = "MyForm"; + + + } + } +} diff --git a/Test_Form_Vererbung/Program.cs b/Test_Form_Vererbung/Program.cs new file mode 100644 index 0000000..2ed90b5 --- /dev/null +++ b/Test_Form_Vererbung/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_Vererbung +{ + 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_Vererbung/Properties/AssemblyInfo.cs b/Test_Form_Vererbung/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a25a046 --- /dev/null +++ b/Test_Form_Vererbung/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_Vererbung")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Test_Form_Vererbung")] +[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("3353ed83-e328-42e3-8825-c3dbf6c3baac")] + +// 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_Vererbung/Properties/Resources.Designer.cs b/Test_Form_Vererbung/Properties/Resources.Designer.cs new file mode 100644 index 0000000..3c984e9 --- /dev/null +++ b/Test_Form_Vererbung/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_Vererbung.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_Vererbung.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_Vererbung/Properties/Resources.resx b/Test_Form_Vererbung/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Test_Form_Vererbung/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_Vererbung/Properties/Settings.Designer.cs b/Test_Form_Vererbung/Properties/Settings.Designer.cs new file mode 100644 index 0000000..f6db2c5 --- /dev/null +++ b/Test_Form_Vererbung/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_Vererbung.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_Vererbung/Properties/Settings.settings b/Test_Form_Vererbung/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Test_Form_Vererbung/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Test_Form_Vererbung/Test_Form_Vererbung.csproj b/Test_Form_Vererbung/Test_Form_Vererbung.csproj new file mode 100644 index 0000000..cd333b1 --- /dev/null +++ b/Test_Form_Vererbung/Test_Form_Vererbung.csproj @@ -0,0 +1,98 @@ + + + + + Debug + AnyCPU + {3353ED83-E328-42E3-8825-C3DBF6C3BAAC} + WinExe + Test_Form_Vererbung + Test_Form_Vererbung + 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 + + + BaseForm.cs + + + Form + + + Form1.cs + + + Form + + + MyForm.cs + + + + + BaseForm.cs + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file