From 886e1d79114626c9ff69175fd58246d2c5e12a39 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Sat, 23 Feb 2019 12:20:24 -0600 Subject: [PATCH] allow DHCP range to cancel The problem is easily seen most times when a DHCP range is canceled. The cancel completely fails to work, and refuses to cancel until correct values are put in start and end. (However, pressing the ESC key sometimes helped.) --- EduNetworkBuilder/IPAddressEntry.Designer.cs | 1 + EduNetworkBuilder/IPAddressEntry.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/EduNetworkBuilder/IPAddressEntry.Designer.cs b/EduNetworkBuilder/IPAddressEntry.Designer.cs index 8bd79a6..fd16518 100644 --- a/EduNetworkBuilder/IPAddressEntry.Designer.cs +++ b/EduNetworkBuilder/IPAddressEntry.Designer.cs @@ -103,6 +103,7 @@ this.btnCancel.Text = "Cancel"; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + this.btnCancel.CausesValidation = false; // // btnOK // diff --git a/EduNetworkBuilder/IPAddressEntry.cs b/EduNetworkBuilder/IPAddressEntry.cs index 6c50d24..a9100cb 100644 --- a/EduNetworkBuilder/IPAddressEntry.cs +++ b/EduNetworkBuilder/IPAddressEntry.cs @@ -194,6 +194,8 @@ namespace EduNetworkBuilder private void tbGateway_Validating(object sender, CancelEventArgs e) { + if (!WellDone) return; + Network mynet = NB.GetNetwork(); if (ParentDevice != null) { @@ -221,6 +223,8 @@ namespace EduNetworkBuilder private void tbNetmask_Validating(object sender, CancelEventArgs e) { + if (!WellDone) return; + UInt32 taddress = tbNetmask.Text.ParseIp(); tbNetmask.Text = taddress.ToIpString(); if (DHCPInterface != null) @@ -236,6 +240,8 @@ namespace EduNetworkBuilder private void tbIPAddress_Validating(object sender, CancelEventArgs e) { + if (!WellDone) return; + UInt32 taddress; Network mynet = NB.GetNetwork(); NB_IPAddress tIPAddress = null;