Click to See Complete Forum and Search --> : *** URGENT *** -- Reposting -- How to programatically resize and move an Edit Control within a Dlg b


April 23rd, 1999, 05:12 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

Roger Osborn
April 23rd, 1999, 05:21 PM
Get a pointer to the control using GetDlgItem().
Use the GetWindowRect() function on it to find where the control currently is, calculate the desired new position, then use MoveWindow() to relocate it where you want it.

Cheers,
Roger.