Click to See Complete Forum and Search --> : HELP!! Resizing and moving a child edit control within a dialog based app


April 23rd, 1999, 12:55 PM
Hello,
I am new to Windows Programming, especially the UI part.... I am facing this problem:
I am writing a dialog based app, that contains a child edit control. I want to decrease the height of the edit control (say, by 'n' units), and shift its position downward by 'n' units.... in a way, creating space above the edit control, to dynamically create other controls. Except for the height and vertical position of the control, nothing changes.

I don't know how to accomplish this. I would appreciate if you could help me out with this.

Thanks a lot in advance,
Narasimha

anuvk
April 23rd, 1999, 11:52 PM
Hi buddy,
I'm not sure but try using SetWindowPos...
There u have options for noresize and nomove and a lot more
hope this helps
anuvk

tchung
April 24th, 1999, 12:55 AM
anuvk is right!

try this!
say " Move edit-contrl to the position where Left-Mouse-Button is clicked. "

void CMyDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
//TODO: Add...
CEdit *pEdit=(CEdit *)GetDlgItem(IDC_EDIT1);
pEdit->SetWindowPos(NULL,point.x,point.y,30,40,SWP_DRAWFRAME);

CDialog::OnLButtonDown(nFlags,point);
}

I hope that this solution is your answer!


by <I><font color=cyan>nfuox</font></I>