Thanbk you Tom
No success.
First solution centers the third form inside of MDI, not the child who calls
a third form. It's because the child has Location 0,0 within MDI, but as I
said in my initial post, there is a List Bar on the left side in MDI.
The second solution doesn't work too by many reasons.
My third form must be modal, and I use ShowDialog. ShowDialog is not allowed
for not top level forms, if I try to use Show, the form just doesn't appear.
I don't know why.
I was hoping that there is a simple solution, like the change one or 2
settings. I've been thinking about calculation for Location of the third
form, but decided to look for a more elegant solution.
At least temporarily I'll use your approach - I'll calculate Location for
the third form.
Thank you
Al
<to**************@uniroma1.it> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
hi Al,
try these and let me know:
'SOLUTION 1:
'ChildOfMDIChild is owned MDIChild: stays on top
'of it and moves independently
Dim ChildOfMDIChild1 As New Form
With ChildOfMDIChild1
.Owner = Me
.StartPosition = FormStartPosition.Manual
.Location = New Point(.Owner.Left + (.Owner.Width - .Width)
\ 2, _
.Owner.Top + (.Owner.Height -
.Height) \ 2)
.Show()
End With
'SOLUTION 2:
'ChildOfMDIChild is within MDIChild and moves with it
'cannot exit from MDIChild (behaves somehow like a control)
Dim ChildOfMDIChild2 As New Form
With ChildOfMDIChild2
.TopLevel = False
.Parent = Me
.Location = New Point((.Parent.Width - .Width) \ 2, _
(.Parent.Height - .Height) \ 2)
.Show()
End With
-tom
Al ha scritto:
I tried to set
Me.Parent = Supplier (Supplier is a caller form) and got an error:
Top-level control cannot be added to a control.
ParentForm property is ReadOnly, so I cannot use it.
Then I tried
Me.Owner = Supplier
It doesn't center the third form in the calling one. It centers in MDI
Thank you
Al
"SStory" <no****@nospam.com> wrote in message
news:Oq**************@TK2MSFTNGP05.phx.gbl... > What if you set the owner or parent property of the subchild form to
> the
> childform?
>
> "vul" <aa*@optonline.net> wrote in message
> news:Oc**************@TK2MSFTNGP04.phx.gbl...
>>I have an MDI application with a ListBar on the left side of MDI form.
>>All
>>child forms are displayed inside of the client area of MDI form.
>> Now I need to display a third form from a child and center it related
>> to
>> the calling Child form. I cannot find the way to do that.
>>
>> Any help please
>> Al
>>
>>
>
>