Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 12: Dialog-Based Windows Visual C++ and MFC Fundamentals


13.4.2..Control’s Location and Size Using Grids........................................


To help position the controls you are adding at design time, you can display some guiding

grid dots. To do this, you can click the Toggle Grid button. In this case, the control
can be positioned and resized anywhere in the area inside the borders of the parent
window, using the grids as guides, as seen on the above red rectangle. No control can be
positioned outside of the client area. The dots on this view control the location and
position of the control:

When you click the body of the parent, the top-left corner of the control would be
positioned on a dot and the dimensions (width and height) of the control would align with
the next dots on its right and bottom. To avoid this default behavior, before clicking the
body of the parent, press and hold Alt; then click and drag to draw a rectangle shape of
Free download pdf