visual c++ - How to move controls from the bottom to the top of an MFC form? -
In VC ++ 6.0 (MFC), how to control such: buttons, edit boxes, and static text moved from below The form at the top of the form can be
You can use CWnd :: MoveWindow () to move controls. CWnd :: GetDlgItem () will retrieve the CWnd for a given control ID.
Some pseudocodes should be called within the square of the window, which is the parent of the control:
reset window; GetClientRect (& amp; windowRect); // Current window bundle CWnd * controlWindow = GetDlgItem (controlId); RET control controls; ControlWindow- & gt; GetWindowRect (& amp; controlRect); // Control Rectangle ScreenToCallant (& amp; controlRect); // parent const int vertOffset = windowRect.top - controlRect.top; in the coordinate system in the directive system // Adjust how much control; .net + = vertOffset; ControlRect.bottom + = vertOffset; Control Window- & gt; Move window (& amp; control);
Comments
Post a Comment