From 966f4fe8a856b7c1f8d882ed07c622f6b4bf04d6 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Wed, 6 Mar 2019 12:29:19 +0300 Subject: [PATCH] Add the ability to prompt for a network, subnet, and gateway. Used when renumbering a subnet. --- EduNetworkBuilder/IPAddressEntry.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/EduNetworkBuilder/IPAddressEntry.cs b/EduNetworkBuilder/IPAddressEntry.cs index b2ded60..7d8aae6 100644 --- a/EduNetworkBuilder/IPAddressEntry.cs +++ b/EduNetworkBuilder/IPAddressEntry.cs @@ -22,6 +22,7 @@ namespace EduNetworkBuilder Point StartLocation = new Point (50,50); NB_IPAddress SavedIPAddress = null; + ToolTip myTooltip = new ToolTip(); public IPAddressEntry(NB_IPAddress toEdit, NetworkDevice ToEdit, Form ParentForm, bool JustPinging=false) @@ -271,5 +272,27 @@ namespace EduNetworkBuilder if (tLocation.X < 0 || tLocation.Y < 0) tLocation = new Point(50, 50); Location = tLocation; } + + public void ShowAsSubnetGateway() + { + lblIP.Text = NB.Translate("IPE_Network"); + Text = NB.Translate("NB_Subnet"); + + myTooltip.AutoPopDelay = 5000; + myTooltip.InitialDelay = 1000; + myTooltip.ReshowDelay = 500; + // Force the ToolTip text to be displayed whether or not the form is active. + myTooltip.ShowAlways = true; + + myTooltip.SetToolTip(tbIPAddress, NB.Translate("IPE_NetworkTooltip")); + myTooltip.SetToolTip(tbGateway, NB.Translate("IPE_GatewayTooltip")); + myTooltip.SetToolTip(tbNetmask, NB.Translate("IPE_NetmaskTooltip")); + + myTooltip.SetToolTip(lblIP, NB.Translate("IPE_NetworkTooltip")); + myTooltip.SetToolTip(lblGateway, NB.Translate("IPE_GatewayTooltip")); + myTooltip.SetToolTip(lblNetmask, NB.Translate("IPE_NetmaskTooltip")); + + ShowDialog(); + } } }