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
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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 */);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top