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
|
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) |
![]() |
30[3] |
![]() |
70[4] |
![]() |
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.
-
These examples demonstrate different
Widthproperty values for the same button editor with one embedded button under the following conditions:- The
Office2016Colorfulskin is in effect. - The Kind property is set to bkText.
- The Caption property is set to
'Search'. - The ContentAlignment property is set to
taCenter(default).
- The
-
The parent editor calculates the button’s width automatically.
-
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.
-
You can change text content alignment if the button width exceeds text length.


