How to notify all controls within CTabCtrl what they should be redrawn(should change their size)?

StackOverflow https://stackoverflow.com/questions/16234298

  •  13-04-2022
  •  | 
  •  

Pregunta

I got an instance of MYListCtrl which is derived class from the CListCtrl within CTabCtrl instance. I have implemented onSize method for MYCListCtrl, and mapped it to the WM_SIZE message.

I want to change size of MYListCtrl when window which includes CTabCtrl is resized, resizing should be based on the dimensions of CTabCtrl. How can I notify MYListCtrl what resizing is needed?

¿Fue útil?

Solución

You need to implement onsize for the parent, i.e. the tab control. When the tab control.onresize is called it should in turn resize the list control. With setwindopos you can resize your list control. Something like this:

void MyTabControl::OnSize(UINT nType, int cx, int cy)
{
    m_ListControl.SetWindowPos(/*various parameters */);
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top