Thanks for taking your time to read this post.
I open a form from my main application for by the following method:
And closing form events....
I am having a strange issue. Whenever I close and re-open the form, I get two message boxes instead of 1. I use many different messageboxes for pass/fail, whenever its the first time I open the form, I get one message box. But if I re-open, I get two! It is really strange. I assume I am creating and disposing of the instance of the form incorrectly. Thoughts? I have spent many hours trying to figure this out with zero success.
I open a form from my main application for by the following method:
Private Sub HoneywellToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles HoneywellToolStripMenuItem1.Click Honeywell_Form_Open = True If SecondForm.IsDisposed = True Then Try SecondForm = New Honeywellvb Catch ex As Exception MessageBox.Show(ex.Message) End Try End If Try Me.TopMost = False SecondForm.Show() Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub
And closing form events....
Private Sub Honeywellvb_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing Main.Honeywell_Form_Open = False test1_complete = False test2_complete = False test3_complete = False 'test4_complete = False serial_num_complete = False Main.Honeywell_productionSettings(Main.D_MAX_INRUSH_EXTEND) = 0 Main.Honeywell_productionSettings(Main.D_EXTEND_TIME) = 0 Main.Honeywell_productionSettings(Main.D_EXTEND_I_AVERAGE) = 0 Main.Honeywell_productionSettings(Main.D_MAX_INRUSH_RETRACT) = 0 Main.Honeywell_productionSettings(Main.D_RETRACT_TIME) = 0 Main.Honeywell_productionSettings(Main.D_RETRACT_I_AVERAGE) = 0 Main.Honeywell_productionSettings(Main.D_EXTEND_TIME_T2) = 0 Main.Honeywell_productionSettings(Main.D_RETRACT_TIME_T3) = 0 Main.Honeywell_productionSettings(Main.D_COMPRESSION_DATAT4) = 0 Try Main.Stop_Honeywell_Fixure_Mode() Catch ex As Exception MsgBox(ex.Message) End Try Try Me.Dispose() Catch ex As Exception MsgBox(ex.Message) End Try End Sub
I am having a strange issue. Whenever I close and re-open the form, I get two message boxes instead of 1. I use many different messageboxes for pass/fail, whenever its the first time I open the form, I get one message box. But if I re-open, I get two! It is really strange. I assume I am creating and disposing of the instance of the form incorrectly. Thoughts? I have spent many hours trying to figure this out with zero success.
Last edited by a moderator: