|
-
May 26th, 2003, 03:07 PM
#1
Thread Starter
Fanatic Member
open form modally [resolved!]
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
Last edited by nswan; May 26th, 2003 at 04:46 PM.
-
May 26th, 2003, 03:10 PM
#2
Thread Starter
Fanatic Member
Dim frm As New frmAddProduct()
frm.ShowDialog()
works!
-
May 26th, 2003, 03:19 PM
#3
Thread Starter
Fanatic Member
damm that doesn't run the form_load routine then on the form you are opening. Any ideas?
-
May 26th, 2003, 03:37 PM
#4
Frenzied Member
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
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
May 26th, 2003, 03:43 PM
#5
Thread Starter
Fanatic Member
i have this code on one form
Code:
Dim frm As New frmAddProduct()
frm.ShowDialog()
but it doesn't run
Code:
Private Sub frmAddProduct_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
-
May 26th, 2003, 03:45 PM
#6
Frenzied Member
But you didnt clarify how you say it doesnt run?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
May 26th, 2003, 03:47 PM
#7
Thread Starter
Fanatic Member
it doesn't execute the code in that sub routine. I put a break point on it and it doesn't stop.
-
May 26th, 2003, 03:55 PM
#8
Frenzied Member
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.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
May 26th, 2003, 04:01 PM
#9
Thread Starter
Fanatic Member
well i put a message box in the form_load code anyways and it doesn't open that
-
May 26th, 2003, 04:03 PM
#10
Frenzied Member
will u send me the problematic part of project to test it?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
May 26th, 2003, 04:04 PM
#11
Thread Starter
Fanatic Member
-
May 26th, 2003, 04:45 PM
#12
Thread Starter
Fanatic Member
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
-
May 26th, 2003, 05:10 PM
#13
Frenzied Member
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()
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|