Size - cUIObject

Determines the size of a window in dialog units

Type: Property

Access: Read/Write

Data Type: Folded Integer

Parameters: None


Size determines the size of object in dialog units. An object's size is typically set as part of an object's definition. You can change the size of any object at any time by setting the Size property.

Dialog units are logical sizing units. If you wish to get or set an object's size using pixels use the GuiSize property.

Window Bounding and Client Area Sizing

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, piMinSize, and piMaxSize will apply to the window's client area. When False, these properties apply to the outer, non-client area.

All other objects use window bounding sizing (outer sizing).

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.

The property is set as follows:

Set Size to iHeight iWidth

The property is retrieved as follows:

Get Size to iValue
Move (Hi(iValue)) to iHeight
Move (Low(iValue)) to iWidth

If you wish to allow end users to resize objects by dragging their borders, 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. You will likely also want to set the object's peAnchors property to allow for automatic sizing based on the object's location in it's parent container object.

ComboForm Height and Vertical Label Location

The height of a ComboForm (or dbComboForm) is more or less fixed by Windows, so you could technically set the height to be anything and the combo form itself would look the same. e.g.

Set Size to 13 95
Set Size to 60 95

The two lines of code above would produce a combo form that looks identical.

However, the Label (Label_Object) of a combo form is positioned to be centered with the height, so we recommend keeping the height always at 13 for consistent label height centering.

If you must set a different height, you can set the Label_Row_Offset to determine the label's vertical location.

Set Label_Row_Offset to 1

Size is not supported in the cSplitterContainer class.

See Also

Location | pbSizeToClientArea | piMinSize | piMaxSize | GuiSize | GuiWindowSize | GuiClientSize | GuiLocation