geek225
geek225

Reputation: 157

Load a bmp file into a TSpeedButton

Using Embarcadero C++Builder, does anyone know how to manually load a .bmp file into a TSpeedButton using the Glyph property, setting a path to the image, not with the Object Inspector?

Upvotes: 0

Views: 206

Answers (1)

Ted Lyngmo
Ted Lyngmo

Reputation: 118097

The Glyph property is a TBitmap, so you can use the TBitmap::LoadFromFile() method to load a new glyph from a file:

speedbutton->Glyph->LoadFromFile("filename.bmp");

Note: "Glyph can provide up to four images within a single bitmap. All images must be the same size and next to each other in a horizontal row."

Upvotes: 2

Related Questions