Resizing Controls in MFC

前端 未结 8 2005
萌比男神i
萌比男神i 2021-01-11 10:26

I am writing a program which has two panes (via CSplitter), however I am having problems figuring out out to resize the controls in each frame. For simplicity,

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-11 10:35

    It is better to use the Dynamic Layout capabilities of each control at the Property section.

    Let's say you want to have a specific control, like a heading, always at the center of the view/dialog, then you just choose the properties of Dynamic Layout of the control, Moving Type as Horizontal and Moving X as 50 but you keep sizing to None. This way, when you resize the view, the header remains always at the center. You have to keep in mind that the minimum of the resizing/moving is the size/position of the control within the dialog/view, when you designed it at the Resource View.

    This way, you save the burden of geometry and the transformations.

提交回复
热议问题