How to Show bitmap image in Tspeedbutton when it is in disables state
Asked Answered
H

1

5

I am dyanamically creating speedbuttons in tab change procedure, i want to made speed button disabled , when it is disabled it is not showing the loaded image. how to show the image on speed button when it is in disable state. I am using the code SpeedButton,SpeedButton.Glyph.LoadFromFile(Path) AND USING SpeedButton.numGlyphs =1

Hyp answered 27/7, 2012 at 10:57 Comment(0)
C
3

The image used in the Glyph can contain upto 4 images, one for each state of the SpeedButton (up, down, disabled, selected).

The images are placed adjacent to each other in a single bitmap file that is used for the Glyph property of the SpeedButton. Use NumGlyphs to indicate how many images are used in the Glyph (eg. you can use only 2 or only 3 images).

Read the documentation on SpeedButton Glyph property.

Cacodemon answered 30/7, 2012 at 22:15 Comment(2)
The order is actually Up, Disabled, Clicked, Down. Having one image means it's used for all states, two are used for Up and Disabled, and so forth. The link to the most recent docs (which still applies to D7, as TSpeedButton hasn't changed much) is here. If only one image is provided, the VCL creates a masked version of it to use for the disabled state, which is often hidden (invisible) or only partially drawn.Truda
This does not do the trick when the glyph comes from an action. I even have DisabledImages assigned on the action manager (which I have pointed to the same as the regular images), thus the Glyph gets automagically assigned. However, it does not accommodate for disabled images. Setting GlyphCount to 1 does nothing either.Orthman

© 2022 - 2024 — McMap. All rights reserved.