user6336941 user6336941 - 1 year ago 73
C Question

Set Width and Height As 100% For an Edit Control

How do I make an Edit Control have its width and height as 100% of the window.

A good example of this is the Edit Control in Notepad.

Up till now, I've been setting the size of controls in the CreateWindow() function as static integers.


0, 0, 640, 480, hWnd, NULL, NULL, NULL);

I am using C and Visual Studio 2015.

Thanks in advance.

Answer Source

You have to handle WM_SIZE messages in your main window procedure and use SetWindowPos API call to resize an edit control.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download