Skip to main content

TcxCustomSplitter.AutoPosition Property

Specifies whether expansion of the collapsed splitter moves it to its previous position or to the position specified by the PositionAfterOpen property.

Declaration

property AutoPosition: Boolean read; write; default True;

Property Value

Type Default
Boolean True

Remarks

End-users can hide the splitter’s bound control using two methods. First by clicking on the hot zone, if it is enabled. The second is to drag the splitter to the corresponding edge of its container. You can also hide the control using code by changing the splitter’s State property value or by calling the CloseSplitter method. Note that the splitter’s position before movement is stored regardless of the method used.

After the splitter’s bound control has been hidden, it can be shown again in a number of ways. If done by dragging the splitter away from the container’s edge, its new position will be the place where it is dropped. Other methods of showing the bound control are to click the splitter’s hot zone (if enabled), to use the State property or the OpenSplitter method. If one of these is used, the splitter will be moved either to its previous position or to the position specified by the PositionAfterOpen property, depending on the AutoPosition property value.

If the splitter’s bound control (a panel, for instance) does not have resizable contents, it is best to set the AutoPosition property to False. In this case, opening the splitter will set its position to the fixed value specified by the PositionAfterOpen property. If the contents are resizable (e.g. containing a grid or memo) you will want to set the AutoPosition property to True. In this case, end-users can move the splitter as needed and its original position will be restored after closing and opening again.

The table below shows examples when the AutoPosition property is set to True and False.

AutoPosition is True AutoPosition is False
1. The original position of the elements. 1. The original position of the elements.
An Open (Expanded) Splitter with Enabled AutoPosition An Open (Expanded) Splitter with Disabled AutoPosition
2. Splitter is closed. 2. Splitter is closed.
A Closed (Collapsed) Splitter with Enabled AutoPosition A Closed (Collapsed) Splitter with Disabled AutoPosition
3. Splitter is reopened. 3. Splitter is reopened (width of the left panel equals the PositionAfterOpen property value).
A Reopened Splitter with Enabled AutoPosition A Reopened Splitter with Disabled AutoPosition

Note

You can also control whether the splitter can move by handling the OnCanResize event.

The default value of the AutoPosition property is True.

See Also