piMinSize and piMaxSize have been added to the Component object (dbView, ModalPanel, etc) to limit the size to which the Component can be resized. Allowing the end-user to change the sizes of Components (dbView, ModalPanels, etc.) brings a new challenge: specifically, the temptation to see what happens when the Component is expanded as large as it will go. There is to limit the maximum size that a Component can be. You achieve this by setting the piMaxSize property.
When this property is set, two integer parameters are passed as specified in the parameter list. When the value of the property is retrieved, the value of these two properties is returned as a folded integer. The value of these parameters can be accessed using the hi() and low() functions.
Get piMaxSize of oForm to iValue Move (Hi(iValue)) to iHeight Move (Low(iValue)) to iWidth
piMaxSize is set as a single property passing the height and width as two separate parameters.
Set piMaxSize of oForm to iHeight iWidth
In this example, the Component's maximum size will be the same as the size of the object, meaning that it can only get smaller. If you wish, you can set it to be larger, but test it to be certain that it cannot be expanded to an unacceptable size.
Set Size To 100 250 Set piMaxSize To 100 250
You can control the maximum size to which a Component can be resized by setting the piMaxSize property:
Set Size To 100 100 Set piMaxSize To 50 50 Set piMaxSize To 200 600
A value of 0;0 means there is no maximum size.
The pbSizeToClientArea property in container objects allows for sizing to be based on a container's window bounding (outer) size or (inner) client area size. When True, client area sizing is used and sizing properties Size, GuiSize, piMaxSize, and piMaxSize will apply to the window's client area. When False, these properties apply to the outer, non-client area.
You need to ensure that you set the Component's Border_Style property to Border_Thick (which is not the default); otherwise, Windows will not let the end-user change the size of the Component.
Think carefully about how you want to set the anchors. It is entirely possible to set anchors in such a way that they will not logically work together. For example, if you have two Forms on the same row and you set them both to anchor left-and-right, they will overlap each other, as the Component gets wider (the first Form's right edge will go beyond the left-unmoving-edge of the second Form.). The solution would be to make one anchor left-and-right, but the other to be anchored left (if it was the first control) or right (if it was the second control). Alternatively, if you really want them both to get wider, then put them on different rows.
piMinSize and piMaxSize values can be set out range. They are out of range when the minimum size is greater than the initial size or when the maximum size is less than the initial size. When this occurs, it is a programming error and the object's behavior will be incorrect. Avoid this condition.