¿Cómo cambio el tamaño de un control WPF dentro de un CWnd?
Estoy hospedando un WPFUserControl
dentro de un MFCCWnd
. Funciona a la perfección. Ahora necesito averiguar cómo cambiar el tamaño del control con su padre. He enganchado elOnSize
y estoy llamandoGetWindowRect
y poniendo el resultado a mi control como tal:
void CChildFrame::OnSize(UINT nType, int cx, int cy)
{
CRect rect;
this->GetWindowRect(&rect);
m_mainControl->Width = rect.Width();
m_mainControl->Height = rect.Height();
}