1
VC++ 6.0 (MFC)에서 Button, EditBox 및 Static Text와 같은 컨트롤을 양식 맨 아래에서 양식 맨 위로 이동하는 방법은 다음과 같습니다.컨트롤을 MFC 폼의 맨 아래에서 맨 위로 이동하는 방법?
VC++ 6.0 (MFC)에서 Button, EditBox 및 Static Text와 같은 컨트롤을 양식 맨 아래에서 양식 맨 위로 이동하는 방법은 다음과 같습니다.컨트롤을 MFC 폼의 맨 아래에서 맨 위로 이동하는 방법?
컨트롤을 이동하려면 CWnd :: MoveWindow()를 사용할 수 있습니다. CWnd :: GetDlgItem() 주어진 컨트롤 ID에 대한 CWnd를 검색합니다. 내가 더 명확 얻을 것이다,
RECT windowRect;
GetClientRect(&windowRect);// Bounds of the current window
CWnd* controlWindow = GetDlgItem(controlId);
RECT controlRect;
controlWindow->GetWindowRect(&controlRect);//control rectangle
ScreenToClient(&controlRect);//control rectangle in the coordinate system of the parent
const int vertOffset = windowRect.top - controlRect.top;//how much to adjust
controlRect.top += vertOffset;
controlRect.bottom += vertOffset;
controlWindow->MoveWindow(&controlRect);
당신이 코드 나 예제의 샘플을 표시 할 수 있습니다 :
일부 의사
는 컨트롤의 부모 윈도우의 클래스 내부에서 호출 할 수 있습니다. –샘플 코드가 나에게 잘 어울립니다. – Jeff