Visual C++ Question:

How to change the position of Button at runtime?

Tweet Share WhatsApp

Answer:

Assuming that you have set the button's ID as IDC_BTNSAMPLE in the resource editor :-
CButton *pBtnSample = (CButton *)GetDlgItem(IDC_BTNSAMPLE);
pBtnSample->SetWindowPos(0,0,0,100,100,SWP_FRAMECHANGED);

Download Visual C++ PDF Read All 10 Visual C++ Questions
Previous QuestionNext Question
How to change the Size of CButton at Runtime?How to change the Properties of a Button at runtime?