comparison ServerMonitor/Forms/QuickHelpForm.cs @ 0:3e1a2131f897

Initial commit. Ping check, scheduling, UI working. SSH check mostly working.
author Brad Greco <brad@bgreco.net>
date Mon, 31 Dec 2018 18:32:14 -0500
parents
children 2db36ab759de
comparison
equal deleted inserted replaced
-1:000000000000 0:3e1a2131f897
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Threading.Tasks;
9 using System.Windows.Forms;
10
11 namespace ServerMonitorApp
12 {
13 public partial class QuickHelpForm : Form
14 {
15 private string Rtf;
16
17 public QuickHelpForm()
18 {
19 InitializeComponent();
20 }
21
22 public QuickHelpForm(string rtf)
23 {
24 InitializeComponent();
25 Rtf = rtf;
26 }
27
28 private void QuickHelpForm_Load(object sender, EventArgs e)
29 {
30 (Owner as CheckForm).HelpLocationChanged += Owner_HelpPositionChanged;
31 HelpTextBox.ContentsResized += HelpTextBox_ContentsResized; // Causes form to resize after Rtf is assigned
32 HelpTextBox.Rtf = Rtf;
33 }
34
35 private void HelpTextBox_ContentsResized(object sender, ContentsResizedEventArgs e)
36 {
37 Height = e.NewRectangle.Height + 12;
38 }
39
40 private void Owner_HelpPositionChanged(object sender, HelpLocationChangedEventArgs e)
41 {
42 Point location = e.HelpLocation;
43 location.Offset(24, 0);
44 Location = location;
45 }
46
47 private void Control_KeyDown(object sender, KeyEventArgs e)
48 {
49 if (e.KeyCode == Keys.Escape)
50 Close();
51 }
52
53 private void Control_Click(object sender, EventArgs e)
54 {
55 Close();
56 }
57 }
58 }