Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How does c++ create controls such as ctabctrl in cform class windows to keep the relative position (i.e. the change of proportion) unchanged when the window is enlarged?
How does c++ create controls such as ctabctrl in cform class windows to keep the relative position (i.e. the change of proportion) unchanged when the window is enlarged?
Just add code to the OnSize () event and change the size of the control.

If so:

CTabCtrl m _ TC

Then add the following in OnSize ():

CRect rt

GetWindowRect(& amp; rt);

screento client(& amp; rt);

Adjust the control position here, for example:

rt.SetRect(rt.left+2,rt.top+2,rt.right-2,rt . bottom-2);

Then m _ tc.setwindowrect (&; rt); It doesn't matter.