Hi,
how do i open a form so the code does not continue on the parent form until the form closes. I think it used to be vbmodal or something in VB6 but can't work it out in vb.net
many thanks
Nick
Printable View
Hi,
how do i open a form so the code does not continue on the parent form until the form closes. I think it used to be vbmodal or something in VB6 but can't work it out in vb.net
many thanks
Nick
Dim frm As New frmAddProduct()
frm.ShowDialog()
works!
damm that doesn't run the form_load routine then on the form you are opening. Any ideas?
How comes ???
Everything should run, unless you are trying to close the modal form on load event, which can not be achived that way in Framework 1.0
i have this code on one form
but it doesn't runCode:Dim frm As New frmAddProduct()
frm.ShowDialog()
:confused:Code:Private Sub frmAddProduct_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
But you didnt clarify how you say it doesnt run?
it doesn't execute the code in that sub routine. I put a break point on it and it doesn't stop.
Thats weird, I dont have a problem here. If your form is shown then for sure it runs form_load event.
I think i dont need to say that when u put a break point u have to press F11, not F5 to stop on it.
well i put a message box in the form_load code anyways and it doesn't open that
will u send me the problematic part of project to test it?
ok i'll email it to you.
well i found a work around.
I called the form_load event thing on the form i was opening sLoad and made it public. I then called sLoad before frm.showdialog.
it's works but doesn't explain why it didn't before
Ok, I found where the problem lies, but have no idea why it happens.
Comment these two lines in the Wizard Generated Code. You can find the near the end of that piece of code.
CType(Me.imcProductID, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.imcProductName, System.ComponentModel.ISupportInitialize).EndInit()