Difference between revisions of "TBitBtn"
m |
(How to control position of glyph and caption) |
||
Line 6: | Line 6: | ||
[[image:component-TBitBtn.png]] | [[image:component-TBitBtn.png]] | ||
+ | |||
+ | Positioning of glyph and caption can be controlled by means of these properties: | ||
+ | * <code>Layout</code> is an enumeration of <code>blGlyphLeft</code>, <code>blGlyphRight</code>, <code>blGlyphTop</code> and <code>blGlyphBottom</code> which determines whether the glyph will be placed at the left, right, above or below the caption, respectively. Default: <code>blGlyphLeft</code>. | ||
+ | * <code>Margin</code> is the distance between the edge of the button and glyph, in pixels. The value -1 means that the combination of glyph and caption is centered within the button. Default: <code>-1</code>. | ||
+ | * <code>Spacing</code> is the distance between the glyph and the caption, in pixels. The value -1 means that the caption is centered between glyph and button edge. If <code>Margin</code> is -1, too, then glyph and caption will be equally distributed within the button area. Default: <code>4</code>. | ||
+ | If you have several vertically stacked BitBtn components (with <code>Layout=blGlyphLeft</code>) on a form and want to left-align glyphs and captions set <code>Margin</code> and <code>Spacing</code> to some positive value, such as 4. | ||
==See also== | ==See also== |
Revision as of 12:55, 8 October 2018
│
Deutsch (de) │
English (en) │
español (es) │
suomi (fi) │
français (fr) │
日本語 (ja) │
polski (pl) │
русский (ru) │
TBitBtn is a component that creates a button with a bitmap drawn on its surface. A TBitBtn is a descendant of TWinControl and is available under the Additional tab of the Component Palette.
To make usage of standard buttons a bit easier a TBitBtn has a property Kind that let you select a buttonkind like bkOk to create an [Ok] button with text and corresponding picture (accessible as Glyph and a modal-result 'mrOk'.
Positioning of glyph and caption can be controlled by means of these properties:
Layout
is an enumeration ofblGlyphLeft
,blGlyphRight
,blGlyphTop
andblGlyphBottom
which determines whether the glyph will be placed at the left, right, above or below the caption, respectively. Default:blGlyphLeft
.Margin
is the distance between the edge of the button and glyph, in pixels. The value -1 means that the combination of glyph and caption is centered within the button. Default:-1
.Spacing
is the distance between the glyph and the caption, in pixels. The value -1 means that the caption is centered between glyph and button edge. IfMargin
is -1, too, then glyph and caption will be equally distributed within the button area. Default:4
.
If you have several vertically stacked BitBtn components (with Layout=blGlyphLeft
) on a form and want to left-align glyphs and captions set Margin
and Spacing
to some positive value, such as 4.
See also