You can create a wrapper control which essentialy houses the ESRI's object inspector window and assures that any resizes are also reflected in the default inspector:
public class WindowContainerControl : Control
{
private readonly IntPtr _childHandle;
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll", SetLastError = true)]
private static extern bool MoveWindow(IntPtr hWnd, int x, int y, int nWidth, int nHeight, bool repaint);
private const int SW_SHOW = 5;
public WindowContainerControl(IntPtr childHandle)
{
_childHandle = childHandle;
}
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
SetParent(_childHandle, Handle);
ShowWindow(_childHandle, SW_SHOW);
}
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
if (IsHandleCreated)
{
MoveWindow(_childHandle, 0, 0, ClientSize.Width, ClientSize.Height, true);
}
}
}
Then, when you create the window for your custom object inspector (I assume it's an UserControl), you add this container in it and associate it with the ESRI's inspector handle. See below.
Here I assume the DefaultPanel is a Panel control in your tab page. Due to some weirdness you cannot place the container control directly to a tab page but you need to use an intermediate panel. Your scenario may be different, but I initialize the controls only when my implementation of IObjectInspector.HWND is first called:
// the container will reparent and house the default inspector
var windowContainer = new WindowContainerControl(_Inspector.HWND);
// when the size of the parent changes, the container's size changes
// as well, in turn the housed inspector window is also resized
windowContainer.Dock = DockStyle.Fill;
// The control containing the tabcontrol and it's pages.
// One of the pages has the panel in it (docked as well), exposed
// as the DefaultPanel property or field.
_myInspectorUserControl = new MyInspectorUserControl();
// Add the container in the custom inspector's designated panel
_myInspectorUserControl.DefaultPanel.Controls.Add(windowContainer);
// return the _myInspectorUserControl hwnd
You may not go for this exact solution (just tested to work in ArcMap 9.3.1), but you get the gist - you basically need to resize the inner default inspector whenever the parent's size changes. The WindowContainerControl class merely does the dirty work of altering its child's size to fill its client area. Thus you only need to dock the WindowContainerControl instance, it takes care of the rest.