|
-
Mar 10th, 2003, 12:18 AM
#1
MDI, MODAL, and Child forms *UNRESOLVED*
I am working on an MDI application and am running into a problem with the forms.
now there is the one main MDI form.. and then there are child forms that are all the same (IE created via in instance of a premade form)
VB Code:
Dim frm as New frmMDIChild
frm.show
so the user can open multiple forms at once.
so now my problem is this, on this child form there is a section where if you select yes to a yes/no option button, a pop up form comes up to be completed. Now this form needs to be modal to the MDI Child form and I am looking at the best way to accomplish this
the only real problem is i can't use the MDI child form as the second parameter when using popupform.show vbModal, owner
it wont let me do it.. and I need that so I can have the popup form show in the center of the MDI child form... any ideas? should I just get the location of the MDI Child form and move the popup form accordingly?
Last edited by kleinma; Mar 10th, 2003 at 01:33 PM.
-
Mar 10th, 2003, 09:11 AM
#2
-
Mar 10th, 2003, 10:19 AM
#3
Frenzied Member
Why do you need the owner parameter? Can't you just show the popup form modally? You could use global variables, maybe in an array keyed to specific child forms, to store the completed popup form data if necessary.
-
Mar 10th, 2003, 10:22 AM
#4
Originally posted by salvelinus
Why do you need the owner parameter? Can't you just show the popup form modally? You could use global variables, maybe in an array keyed to specific child forms, to store the completed popup form data if necessary.
the reason i want to use the MDI Child as the owner of the modal form is because i wanted to open the modal form in the center of the owner... via its start up position property.. but if i can't use the MDI child as the owner... then I will have to find some other way to accomplish this
-
Mar 10th, 2003, 12:43 PM
#5
Frenzied Member
Hmm, don't know, I try to avoid MDI forms. Can it be accessed through the parent form, e.g. parentform.childform1.etcetc?
One trick used in eVB is to use multiple frames, the size of the display, on one form, only showing the relevant one at any one time. If your child forms did this, and your code prevented showing other forms/frames until the form was completely filled in, you could mimic a modal form.
-
Mar 10th, 2003, 12:48 PM
#6
well the app i am making is what MDI was made for.... it is a data entry app to enter applications... and the user may open multiple applications at once
-
Mar 10th, 2003, 01:33 PM
#7
-
Mar 10th, 2003, 02:24 PM
#8
Let me in ..
Originally posted by kleinma
still no luck with this
I do not know whats the big deal in this.
Can't you programmatically position the position of that form instead of having to use the parent form as a owner. ??? Where's the problem in that ?
-
Mar 10th, 2003, 02:44 PM
#9
Originally posted by techyspecy
I do not know whats the big deal in this.
Can't you programmatically position the position of that form instead of having to use the parent form as a owner. ??? Where's the problem in that ?
thats what i am working on now
-
Mar 10th, 2003, 03:21 PM
#10
Frenzied Member
Due to serious limitations in VB's MDI interface that cannot be done without some serious subclassing stuff, perhaps a User Control (and don't expect this to be easy), or generate a "regular" modal window otherwise.
-
Mar 10th, 2003, 03:32 PM
#11
well using this code i did up... it pretty much does what i need it to do... so i think ill be ok with this
I call it in the form load event of any of the forms that pop up off the MDI children forms
VB Code:
Public Sub CenterPopup(Owner As Form, Popup As Form)
On Error GoTo EH:
Dim iTop As Integer
Dim iLeft As Integer
iTop = Owner.Top + ((Owner.Height / 2) - (Popup.Height / 2))
iLeft = Owner.Left + ((Owner.Width / 2) - (Popup.Width / 2))
Popup.Move iLeft, iTop
EH:
End Sub
-
Mar 10th, 2003, 04:01 PM
#12
Frenzied Member
Perhaps, I misread you requirements. If it does what you expect then it's excelent.
-
Mar 10th, 2003, 04:56 PM
#13
Originally posted by McGenius
Perhaps, I misread you requirements. If it does what you expect then it's excelent.
yeah it does the job...
my ultimate goal was to have a modal form be owned by an mdi child, but since by design that is impossible, i show it modal with no owner and center it on top of the mdi child, the only reason i wanted the mdi child to be the owner was for placement of the popup modal form...
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
|