Please enable JavaScript to view this site.

A-Shell Reference

Because the control size is fixed by the system (based on system display parameters), it doesn't make much sense to specify an arbitrary rectangle—although you can, with unpredictable results. Typically, you want the control to be stuck in one of the four corners of the window or dialog, or at least up against an edge. To accomplish this, A-Shell will apply certain logical rules to the coordinates given. The first rule is that if you ask for a size that is less than the minimum width and height needed to display one month, it will be automatically expanded as needed. To take full advantage of this, just set the erow, ecol parameters to match the srow, scol. For example, to put it in the upper left, set the coordinates to 1,1,1,1. The second rule is that if the starting position specified is beyond the width or height of the window, it will be moved to fit. So to position the control in the bottom corner, specify numbers that you know are larger than the size of the window, like 100,100,100,100. (Note that if you specify a row greater than 200, millirows are assumed, which means you would need to specify a much larger value.) With these rules, you can position the control in each of the four corners as follows:

Position

Values

Top left

1,1,1,1

Top right

1,100,1,100

Bottom left

100,1,100,1

Bottom right

100,100,100,100

 

Even with this simplification, you still need to deal with the fact that the actual size may be smaller or larger than you are expecting in terms of the row/column coordinates used for other controls. (This problem is minimized if you use MBF_ALTPOS since at least then the units are based on the font size and resolution, giving the calendar a predictable size of about 6 rows and 17-20 columns, depending on the display options.) But if your dialog grid is based on the main window, then the size of the main window will determine how many rows and columns are actually occupied by the calendar.)

If you specify a rectangle that fits in the window and is large enough to show more than one month, the control will display as many months as it can. (This is not recommended though, as no consideration has yet been given to the special issues that may arise. In particular, the day states option only works for single-month-at-a-time calendars.)