2009-04-28 8 views

답변

4

컨트롤을 이동하려면 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); 
+0

당신이 코드 나 예제의 샘플을 표시 할 수 있습니다 :

일부 의사

는 컨트롤의 부모 윈도우의 클래스 내부에서 호출 할 수 있습니다. –

+0

샘플 코드가 나에게 잘 어울립니다. – Jeff

관련 문제