Sign in Join
Wiki copytemporary

TBitBtn: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: TBitBtn

OldNewLine
1+**TBitBtn** ![](/wiki-images/a/a0/Tbitbtn.png) 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]].
2+
3+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').
4+
5+<figure>
6+<img src="component-TBitBtn.png" title="component-TBitBtn.png" />
7+<figcaption>component-TBitBtn.png</figcaption>
8+</figure>
9+
10+Positioning of glyph and caption can be controlled by means of these properties:
11+
12+- `Layout` is an enumeration of `blGlyphLeft`, `blGlyphRight`, `blGlyphTop` and `blGlyphBottom` which determines whether the glyph will be placed at the left, right, above or below the caption, respectively. Default: `blGlyphLeft`.
13+- `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`.
14+- `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. If `Margin` is -1, too, then glyph and caption will be equally distributed within the button area. Default: `4`.
15+
16+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.
17+
18+## See also
19+
20+- [[doc:lcl/buttons/tbitbtn.html|TBitBtn doc]]
21+- [[TButton]]
22+- [[TSpeedButton]]
23+- [[TColorButton]]
24+
25+---
26+*From the Free Pascal wiki, page "TBitBtn", as it stood on 2024-03-24 after a change by Ariben, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history