how can i change the size of my edit control accordingly when the user maximises or restores the dialog window. I tried to use WM_SIZE, but I am not able to implement it. Pl help.
Printable View
how can i change the size of my edit control accordingly when the user maximises or restores the dialog window. I tried to use WM_SIZE, but I am not able to implement it. Pl help.
hi
use SetWindowPos() function for this:
sample code:
CWnd *myEdit=GetDlgItem(IDC_EDIT1);
myEdit->SetWindowPos(,,,,);
See this SetWindowPos() in msdn for details
Regards
SKP
Be sure to rate answers if it helped, to encourage them.
I tried to use your suggestion in the way
CWnd *myEditBox = GetDlgItem(IDC_EDIT1);
myEditBox->SetWindowPos(&wndTopMost,0,0,200,500,SWP_SHOWWINDOW);
but it gives memory error. I wrote the about func in the OnSize mess handler.
do it as in OnSize
CEdit* edit = (CEdit*)GetDlgItem(ID_OF_UR_CONTROL);
if(edit)
{
//x = left;
//y = top;
//cx = right;
//cy = bottom;
edit->MoveWindow(x,y,cx,cy);
}
Hope this helps
Thanx...
how to get current position of Edit Box on my Dialog :D, so i can resize it in its designed position ??