I have a dialog resource with some controls inside, mostly a user and password edit controls, bonded to a CFormView
. Such dialog is a small rectangle of 300 x 200 pixels.
When I run the application, the CFrameWindow
occupies almost all screen, so the dialog shows in top-left corner. If I try to get the rectangle dimension of CFormView
, I found that it has been expanded to visible area in CMainFrame
, no matter the original dialog size.
My question is whether is possible to keep the dialog (the CFormView
) centred in the middle of the CMainFrame
, and keep always centred even if the ON_SIZE
message is called.
Thank you.
In VS2019 you don't have to write any line of code. The rc Editor has the dynamic layout function capabilities. Place the controls exactly in the middle of the dialog. Then set the