diff ServerMonitor/Forms/AboutForm.cs @ 19:b3128fe10d57

Add About form and license.
author Brad Greco <brad@bgreco.net>
date Wed, 29 May 2019 20:18:37 -0400
parents
children b21318f6e3f1
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ServerMonitor/Forms/AboutForm.cs	Wed May 29 20:18:37 2019 -0400
@@ -0,0 +1,39 @@
+using ServerMonitorApp.Properties;
+using System;
+using System.Diagnostics;
+using System.Reflection;
+using System.Windows.Forms;
+
+namespace ServerMonitorApp
+{
+    /// <summary>Program About form.</summary>
+    public partial class AboutForm : Form
+    {
+        public AboutForm()
+        {
+            InitializeComponent();
+        }
+
+        private void AboutForm_Load(object sender, EventArgs e)
+        {
+            Icon = Resources.icon;
+            NameLabel.Text += " " + Assembly.GetExecutingAssembly().GetName().Version.ToString(2);
+        }
+
+        /// <summary>Hides the form when ESC is pressed.</summary>
+        protected override bool ProcessDialogKey(Keys keyData)
+        {
+            if (keyData == Keys.Escape)
+            {
+                Close();
+                return true;
+            }
+            return base.ProcessDialogKey(keyData);
+        }
+
+        private void HomePageLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            Process.Start("http://bgreco.net/servermonitor");
+        }
+    }
+}