Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TBitBtn - when changing Action Glyph does not change

Status
Not open for further replies.

TimSNL

Programmer
Sep 11, 2001
119
AU
Hello,

I have my form setup with a TBitBtn and a TActionList. The ActionList is linked to a TImageList which contains the images for each action. I have 2 actions in the action list with their own Captions, ImageIndexes, and Execute events.

Now this is what happens ...
At runtime I want to programatically assign one of the two actions the the button and have the correct Caption and Glyph appear on the button. But when I do this the Caption changes and the correct action is executed but the glyph on the button does not change, it just stays the same as the glyph that was associated by the first action that had the button.

Does anyone know why this glyph is not changing to the correct on for the action?

Tim Dover
SNL Computing
 
I have found something that works ...

TheButton.Glyph := nil;
TheButton.Action := NextAction;

Setting the TBitBtn's Glyph property to nil before assigning the new action allows the glyph from the new action to display on the button.

What do you think, is this solution any good?

Tim Dover
SNL Computing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top