diff --git a/VECTO/GUI/BatteryForm.vb b/VECTO/GUI/BatteryForm.vb index 1061abaabcd73b6a2781d9ee01a382b4f7b953fa..5c98f978dc71facf3abe774f9926cc904bb67465 100644 --- a/VECTO/GUI/BatteryForm.vb +++ b/VECTO/GUI/BatteryForm.vb @@ -35,7 +35,11 @@ Public Class BatteryForm Private _contextMenuFiles As String() - + Public ReadOnly Property BatteryFile As String + Get + Return _batteryFile + End Get + End Property 'Before closing Editor: Check if file was changed and ask to save. @@ -392,11 +396,15 @@ Public Class BatteryForm 'Save and close Private Sub ButOK_Click(sender As Object, e As EventArgs) Handles ButOK.Click - If SaveOrSaveAs(False) Then Close() + If SaveOrSaveAs(False) Then + DialogResult = DialogResult.OK + Close() + End If End Sub 'Close without saving (see FormClosing Event) Private Sub ButCancel_Click(sender As Object, e As EventArgs) Handles ButCancel.Click + DialogResult = DialogResult.Cancel Close() End Sub diff --git a/VECTO/GUI/REESSPackDialog.vb b/VECTO/GUI/REESSPackDialog.vb index 629aea2a23e137128bb02f6992d84b766e588015..c61480932e5ec2a110bf7c042396c14834a5795e 100644 --- a/VECTO/GUI/REESSPackDialog.vb +++ b/VECTO/GUI/REESSPackDialog.vb @@ -83,13 +83,9 @@ Public Class REESSPackDialog End If End If - If Not BatteryForm.Visible Then - BatteryForm.Show() - Else - If BatteryForm.WindowState = FormWindowState.Minimized Then BatteryForm.WindowState = FormWindowState.Normal - BatteryForm.BringToFront() - End If - + if BatteryForm.ShowDialog() = DialogResult.OK then + tbBattery.Text = BatteryForm.BatteryFile + end if If Not Trim(f) = "" Then Try BatteryForm.OpenBatteryFile(f)