diff --git a/AboutBox/AboutBox.Designer.cs b/AboutBox/AboutBox.Designer.cs index 518953c..9516c08 100644 --- a/AboutBox/AboutBox.Designer.cs +++ b/AboutBox/AboutBox.Designer.cs @@ -112,8 +112,11 @@ this.Controls.Add(this.labelVersion); this.Controls.Add(this.labelProgramName); this.Controls.Add(this.pictureBox); + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "AboutBox"; this.ShowIcon = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.Load += new System.EventHandler(this.AboutBox_Load); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.ResumeLayout(false); diff --git a/AboutBox/AboutBox.cs b/AboutBox/AboutBox.cs index 319bd31..2f47f8d 100644 --- a/AboutBox/AboutBox.cs +++ b/AboutBox/AboutBox.cs @@ -130,6 +130,14 @@ namespace Eugen.ESystem.Windows.Forms SetContent(programName, programVersion, programCopyright); //Fensterinhalt setzen } + + /// + /// Displays a Program Information Box + /// + /// A valid Program name. + /// A valid version number. + /// The copyrigth Information + /// true = Button is displayed; false = Button is not displayed. public AboutBox(string programName, string programVersion, string programCopyright, bool showDllInfoButton) { InitializeComponent(); @@ -154,7 +162,7 @@ namespace Eugen.ESystem.Windows.Forms /// A valid Program name. /// A valid version number. /// The copyrigth Information - /// valid icon in the size 32x32 dots with path. Larger icons are cropped. E.g.: C\:MyFolder\MyIcon.ico + /// A valid icon in the size 32x32 dots with path. Larger icons are cropped. E.g.: C\:MyFolder\MyIcon.ico /// true = Button is displayed; false = Button is not displayed. public AboutBox(string programName, string programVersion, string programCopyright, Icon icon, bool showDllInfoButton) { @@ -176,6 +184,59 @@ namespace Eugen.ESystem.Windows.Forms SetContent(programName, programVersion, programCopyright); //Fensterinhalt setzen } + /// + /// Displays a Program Information Box + /// + /// A valid Program name. + /// A valid version number. + /// The copyrigth Information + /// A valid icon in the size 32x32 dots with path. Larger icons are cropped. E.g.: C\:MyFolder\MyIcon.ico + /// true = Button is displayed; false = Button is not displayed. + /// Window with: Min. 500, Max. 800. + /// Window hight: Min. 400, Max. 600. + public AboutBox(string programName, string programVersion, string programCopyright, Icon icon, bool showDllInfoButton, int width, int hight) + { + InitializeComponent(); + + //Fenstergröße einstellen + if (width < 500) + { + width = 500; + } + if (width > 800) + { + width = 800; + } + + if (hight < 400) + { + hight = 400; + } + if (hight > 600) + { + hight = 600; + } + + this.Size = new Size(width, hight); + this.MaximumSize = new Size(width, hight); + this.MinimumSize = new Size(width, hight); + + pictureBox.Image = Bitmap.FromHicon(new Icon(icon, new Size(32, 32)).Handle); + + if (showDllInfoButton) + { + buttonDllInfo.Enabled = true; + buttonDllInfo.Visible = true; + } + else + { + buttonDllInfo.Enabled = false; + buttonDllInfo.Visible = false; + } + + SetContent(programName, programVersion, programCopyright); //Fensterinhalt setzen + } + private void AboutBox_Load(object sender, EventArgs e) { DllInfoSelected = false; diff --git a/AboutBox/AboutBox.resx b/AboutBox/AboutBox.resx index e14b7b3..3bb4c80 100644 --- a/AboutBox/AboutBox.resx +++ b/AboutBox/AboutBox.resx @@ -310,13 +310,16 @@ 4 + + + Top, Bottom, Left, Right + 12, 162 True - Vertical @@ -341,6 +344,9 @@ 3 + + Bottom, Left + 12, 341 @@ -365,6 +371,9 @@ 2 + + Bottom, Right + 407, 341 @@ -392,6 +401,9 @@ 17, 17 + + Bottom + False @@ -432,7 +444,7 @@ 492, 369 - 500, 400 + 800, 600 500, 400 diff --git a/Test_AboutBox/Form1.Designer.cs b/Test_AboutBox/Form1.Designer.cs index daf67d4..a860d2f 100644 --- a/Test_AboutBox/Form1.Designer.cs +++ b/Test_AboutBox/Form1.Designer.cs @@ -35,6 +35,7 @@ this.labelDLLInfo = new System.Windows.Forms.Label(); this.buttonAboutWithDllInfo = new System.Windows.Forms.Button(); this.button1buttonAboutWithCustomerIconAndDllInfo = new System.Windows.Forms.Button(); + this.buttonSize = new System.Windows.Forms.Button(); this.groupBoxProgramInfo.SuspendLayout(); this.groupBoxDLLInfo.SuspendLayout(); this.SuspendLayout(); @@ -109,11 +110,22 @@ this.button1buttonAboutWithCustomerIconAndDllInfo.UseVisualStyleBackColor = true; this.button1buttonAboutWithCustomerIconAndDllInfo.Click += new System.EventHandler(this.button1buttonAboutWithCustomerIconAndDllInfo_Click); // + // buttonSize + // + this.buttonSize.Location = new System.Drawing.Point(12, 249); + this.buttonSize.Name = "buttonSize"; + this.buttonSize.Size = new System.Drawing.Size(776, 23); + this.buttonSize.TabIndex = 13; + this.buttonSize.Text = "Über mit Customer Icon, DLL-Informationen und Größe 800x600 anzeigen"; + this.buttonSize.UseVisualStyleBackColor = true; + this.buttonSize.Click += new System.EventHandler(this.buttonSize_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.buttonSize); this.Controls.Add(this.button1buttonAboutWithCustomerIconAndDllInfo); this.Controls.Add(this.buttonAboutWithDllInfo); this.Controls.Add(this.groupBoxProgramInfo); @@ -139,5 +151,6 @@ private System.Windows.Forms.Label labelDLLInfo; private System.Windows.Forms.Button buttonAboutWithDllInfo; private System.Windows.Forms.Button button1buttonAboutWithCustomerIconAndDllInfo; + private System.Windows.Forms.Button buttonSize; } } \ No newline at end of file diff --git a/Test_AboutBox/Form1.cs b/Test_AboutBox/Form1.cs index ca15a39..1ac90d9 100644 --- a/Test_AboutBox/Form1.cs +++ b/Test_AboutBox/Form1.cs @@ -146,9 +146,17 @@ namespace Eugen.ESystem.Windows.Forms private void button1buttonAboutWithCustomerIconAndDllInfo_Click(object sender, EventArgs e) { // Zeigt das 'AboutBox' Fenster mit Customer Icon und DLL-Informationen an - Icon icon = new Icon(@"H:\Programmieren\Git-Repository\VisualStudio\2017\_DLL\AboutBox.git\Daten\Customer.ico"); + Icon icon = new Icon(@"H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\AboutBox.git\Daten\Customer.ico"); var aboutDll = new AboutBox(ProgramName, ProgramVersion, Copyright, icon, true); aboutDll.ShowDialog(); } + + private void buttonSize_Click(object sender, EventArgs e) + { + // Zeigt das 'AboutBox' Fenster mit Customer Icon, DLL-Informationen und der Größe 800x600 an + Icon icon = new Icon(@"H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\AboutBox.git\Daten\Customer.ico"); + var aboutDll = new AboutBox(ProgramName, ProgramVersion, Copyright, icon, true, 800, 600); + aboutDll.ShowDialog(); + } } }