Your C++ shim control should have a code like this, to resize the hosted
.NET usercontrol (m_hwndUsercontrol):
// When the shim is resized, resize the hosted user control.
STDMETHOD(OnSize)(UINT, WPARAM, LPARAM lParam, BOOL& bHandled)
{
if (m_hwndUsercontrol)
::MoveWindow(m_hwndUsercontrol, 0, 0, LOWORD(lParam), HIWORD(lParam),
true);
bHandled = true;
return 0;
}
and your .NET usercontrol should use the Resize event (no need to override
OnResize). In this event, the properties Width and Height of the usercontrol
already have the new values, you don´t need its parent...

Signature
Carlos J. Quintero
The MZ-Tools all-in-one add-in, now for .NET: http://www.mztools.com
> Hi all,
>
[quoted text clipped - 10 lines]
> Thanks
> Thomas
Thomas - 13 Dec 2004 21:05 GMT
It works!
Thanks
Thomas ;-)
> Your C++ shim control should have a code like this, to resize the hosted
> .NET usercontrol (m_hwndUsercontrol):
[quoted text clipped - 27 lines]
>> Thanks
>> Thomas