[Edit]
See this post as to why I'm declaring form elements globally.
I chose to rewire my code to get rid of the global definitions.
[End Edit]
I'm creating a from dynamically at runtime. the form, all buttons, and the combobox are all declared globally to the parent form.
dim myForm as new form
I put some buttons on it and a combo box that I'm filling with stuff.
I can show the form fine with
myForm.show()
myForm.bringToFront()
everything works fine the first time.
when the user is finished with the from, I call:
myForm.close()
'have also tried
' myForm.Hide() and myForm.Dispose()
either way, (even when only calling .close()) the second time the form is created, I get the following error:
ObjectDisposedException was unhandled Cannot access a disposed object.
If I just toggle the visibility of the form, the combobox values aren't wiped out each time - and it seems like sorry practice to just set visibility = false.
why is this happening?