Skip to main content

TcxCustomEditButton.Width Property

Specifies editor button width, in pixels.

Declaration

property Width: Integer read; write; default 0;

Property Value

Type Default Description
Integer 0

The explicitly specified editor button width (in pixels) at 96 DPI. The property value can be 0 or higher.

0 indicates that the actual editor button width is calculated automatically.

Remarks

An editor button automatically calculates its width to fit content in full. You can use the Width property to explicitly specify editor button width.

The button crops content if it does not fit into the available area by width. If the button width exceeds content width, content is centered. You can use the ContentAlignment property to align content to the left or right button border if the Kind property is set to bkText and the Caption property is specified.

Property Value Examples

Value Example[1]
0[2] (default) VCL Editors Library: The Default Button Width
30[3] VCL Editors Library: Reduced Button Width
70[4] VCL Editors Library: Increased Button Width

Property Values and Scaling

The Width property specifies the base editor button width (in pixels) that corresponds to 96 DPI. Editor draw routines multiply the Width property value by the current scale factor and round the result to the nearest integer to calculate actual editor button width on the target screen.

Default Value

The Width property’s default value is 0.

The default Width property value indicates that the parent editor automatically calculates the embedded button’s width.

Footnotes
  1. These examples demonstrate different Width property values for the same button editor with one embedded button under the following conditions:

  2. The parent editor calculates the button’s width automatically.

  3. The button crops text and displays an ellipsis at the end of the caption. If the button width is not enough to display a glyph in full, the glyph is centered and cropped from all sides.

  4. You can change text content alignment if the button width exceeds text length.

See Also