R – Mdi form ensure visible

mdinetuser interfacewindowswinforms

I am developing a c# .NET app with MDI forms.
When the Mdi children are moved around and using the scroll bars some forms will be outside the displayed area.
I would like to do to the Mdi children something similar to TreeNode.EnsureVisible() which moves the TreeView scrollbars until the Node is fully visible.
Calling Form.Activate() doesn't do this.
I don't mind if P/Invoke is required

Thanks in anticipation

Alex

Best Answer

You could call the method ActivateMdiChild(childForm) on the parent Window which bring the focus on the childForm. HTH