C++ MFC button disappears at window resize
问题 I have a Dialog in MFC C++ that has a CButton attached. I want to modify OnSize() so that the button will anchor to bottom-left. if (btn.m_hWnd) { CRect winRect; GetWindowRect(&winRect); int width = winRect.right - winRect.left; int height = winRect.bottom - winRect.top; int x = width - wndWidth; int y = height - wndHeight; CRect rect; btn.GetWindowRect(&rect); rect.left += x; rect.top += y; btn.MoveWindow(&rect); ScreenToClient(&rect); btn.ShowWindow(SW_SHOW); } x and y are the difference of