From 95482df36ca56d754568e27c9fd5e7cfe171583e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eugen=20H=C3=B6glinger?= Date: Tue, 12 Jan 2021 16:34:10 +0100 Subject: [PATCH] =?UTF-8?q?Zus=C3=A4tzliche=20Optionen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fenstergröße kann bei allen Aufrufoptionen definiert werden. --- AboutBox/AboutBox.cs | 98 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 76 insertions(+), 22 deletions(-) diff --git a/AboutBox/AboutBox.cs b/AboutBox/AboutBox.cs index 2f47f8d..eeb164a 100644 --- a/AboutBox/AboutBox.cs +++ b/AboutBox/AboutBox.cs @@ -123,7 +123,6 @@ namespace Eugen.ESystem.Windows.Forms /// 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) { InitializeComponent(); @@ -131,6 +130,24 @@ 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 + /// Window with: Min. 500, Max. 800. + /// Window hight: Min. 400, Max. 600. + public AboutBox(string programName, string programVersion, string programCopyright, int width, int hight) + { + InitializeComponent(); + + //Fenstergröße einstellen + SetWindow(width, hight); + + SetContent(programName, programVersion, programCopyright); //Fensterinhalt setzen + } + /// /// Displays a Program Information Box /// @@ -156,6 +173,36 @@ 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. + /// Window with: Min. 500, Max. 800. + /// Window hight: Min. 400, Max. 600. + public AboutBox(string programName, string programVersion, string programCopyright, bool showDllInfoButton, int width, int hight) + { + InitializeComponent(); + + //Fenstergröße einstellen + SetWindow(width, hight); + + if (showDllInfoButton) + { + buttonDllInfo.Enabled = true; + buttonDllInfo.Visible = true; + } + else + { + buttonDllInfo.Enabled = false; + buttonDllInfo.Visible = false; + } + + SetContent(programName, programVersion, programCopyright); //Fensterinhalt setzen + } + /// /// Displays a Program Information Box /// @@ -199,27 +246,7 @@ namespace Eugen.ESystem.Windows.Forms 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); + SetWindow(width, hight); pictureBox.Image = Bitmap.FromHicon(new Icon(icon, new Size(32, 32)).Handle); @@ -410,5 +437,32 @@ namespace Eugen.ESystem.Windows.Forms return dllInfos.Remove(dllInfos.LastIndexOf("\r\n\r\n")); } + + private void SetWindow(int width, int hight) + { + //Maximalabmaße prüfen + if (width < 500) + { + width = 500; + } + if (width > 800) + { + width = 800; + } + + if (hight < 400) + { + hight = 400; + } + if (hight > 600) + { + hight = 600; + } + + //Fenster setzen + this.Size = new Size(width, hight); + this.MaximumSize = new Size(width, hight); + this.MinimumSize = new Size(width, hight); + } } }