Mercurial > servermonitor
view ServerMonitor/Forms/QuickHelpForm.cs @ 12:d92176c5398a
Better display of schedule name.
author | Brad Greco <brad@bgreco.net> |
---|---|
date | Mon, 15 Apr 2019 19:24:55 -0400 |
parents | 3e1a2131f897 |
children | 2db36ab759de |
line wrap: on
line source
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 ServerMonitorApp { public partial class QuickHelpForm : Form { private string Rtf; public QuickHelpForm() { InitializeComponent(); } public QuickHelpForm(string rtf) { InitializeComponent(); Rtf = rtf; } private void QuickHelpForm_Load(object sender, EventArgs e) { (Owner as CheckForm).HelpLocationChanged += Owner_HelpPositionChanged; HelpTextBox.ContentsResized += HelpTextBox_ContentsResized; // Causes form to resize after Rtf is assigned HelpTextBox.Rtf = Rtf; } private void HelpTextBox_ContentsResized(object sender, ContentsResizedEventArgs e) { Height = e.NewRectangle.Height + 12; } private void Owner_HelpPositionChanged(object sender, HelpLocationChangedEventArgs e) { Point location = e.HelpLocation; location.Offset(24, 0); Location = location; } private void Control_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) Close(); } private void Control_Click(object sender, EventArgs e) { Close(); } } }