mfc get the position of the control on the dialog

Reprinted from: https://www.cnblogs.com/huhu0013/p/3944569.html

CRect rect;

GetDlgItem(Control ID)->GetWindowRect(&rect);//Get the screen coordinates of the control
ScreenToClient(&rect);//Convert to client coordinates on the dialog


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326739986&siteId=291194637