|
-
Dec 24th, 2003, 01:15 PM
#1
Thread Starter
New Member
MDI - ShowDialog alternative ***Resolved***
I have a MDI form that opens a child form (called form1). On this form I want to be able to open another form (Called form2). (Which is also a child form). Once the new form is opened I want the code execution to halt for form1 until form2 is closed. The showdialog function does this but it cannot be done from a child form. Is there any way around this?
The reason I want to do this is so that when form2 comes up i can enter data and then when form2 is closed I can call a method to refresh a combo box on my form1.
Any help will be much appreciated.
Last edited by LIPAE; Dec 24th, 2003 at 03:48 PM.
-
Dec 24th, 2003, 02:29 PM
#2
Maybe try posting your code because it works fine for me.
VB Code:
'in mdi form to show first child
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2
frm.MdiParent = Me
frm.Show()
End Sub
'in that child to show modal child
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As New Form2
f.ShowDialog()
End Sub
Or did you post in the wrong forums? I believe you couldn't do this in VB6 and it looks like most of your other posts were in VB6.
Last edited by Edneeis; Dec 24th, 2003 at 02:33 PM.
-
Dec 24th, 2003, 02:44 PM
#3
Thread Starter
New Member
Nope, I'm working in .net
Dim frmIndustry As New AddEditIndustry
frmIndustry.MdiParent = Me.MdiParent.ActiveForm
frmIndustry.ShowDialog
Me = frmCompany (Also a child form).
frmcompany is a child form of a form called Main (mdi form).
-
Dec 24th, 2003, 03:00 PM
#4
If you want to show it modally then it can't be a MDI child, but why would it need to be? Although it can be shown from an MDI Child. Just remove the line that makes it an MDI child.
-
Dec 24th, 2003, 03:13 PM
#5
Thread Starter
New Member
Yeah I guess I really don't need to make that form a child because it will always stay on top with showdialog method.
Thanks mucho for the help.
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
|