Delphi中TspeedButton禁用状态下如何显示位图图片?
- 内容介绍
- 文章标签
- 相关推荐
本文共计323个文字,预计阅读时间需要2分钟。
在变量程序中,动态创建速度按钮。禁用速度按钮时,不想显示加载的图像。如何在不启用状态下显示速度按钮上的图像?
当前使用代码:+SpeedButton, SpeedButton.Glyph.LoadFromFile(路径)
在不启用状态下显示图像,可以在SpeedButton的Disabled属性上设置一个条件,当按钮被禁用时,加载一个特定的图像。以下是修改后的代码示例:
python假设SpeedButton名为speed_buttonspeed_button.Glyph.LoadFromFile(启用时的路径.png)speed_button.Enabled=True # 初始状态启用按钮
禁用按钮并加载禁用状态下的图像speed_button.Enabled=Falsespeed_button.Glyph.LoadFromFile(禁用时的路径.png)
SpeedButton,SpeedButton.Glyph.LoadFromFile(路径)和使用SpeedButton.numGlyphs = 1 字形中使用的图像最多可包含4个图像,每个图像用于SpeedButton的每个状态(向上,向下,禁用,选定).
图像在一个位图文件中彼此相邻放置,该文件用于SpeedButton的Glyph属性.使用NumGlyphs指示字形中使用了多少图像(例如,您只能使用2个图像或仅使用3个图像).
阅读有关SpeedButton Glyph属性的文档.
本文共计323个文字,预计阅读时间需要2分钟。
在变量程序中,动态创建速度按钮。禁用速度按钮时,不想显示加载的图像。如何在不启用状态下显示速度按钮上的图像?
当前使用代码:+SpeedButton, SpeedButton.Glyph.LoadFromFile(路径)
在不启用状态下显示图像,可以在SpeedButton的Disabled属性上设置一个条件,当按钮被禁用时,加载一个特定的图像。以下是修改后的代码示例:
python假设SpeedButton名为speed_buttonspeed_button.Glyph.LoadFromFile(启用时的路径.png)speed_button.Enabled=True # 初始状态启用按钮
禁用按钮并加载禁用状态下的图像speed_button.Enabled=Falsespeed_button.Glyph.LoadFromFile(禁用时的路径.png)
SpeedButton,SpeedButton.Glyph.LoadFromFile(路径)和使用SpeedButton.numGlyphs = 1 字形中使用的图像最多可包含4个图像,每个图像用于SpeedButton的每个状态(向上,向下,禁用,选定).
图像在一个位图文件中彼此相邻放置,该文件用于SpeedButton的Glyph属性.使用NumGlyphs指示字形中使用了多少图像(例如,您只能使用2个图像或仅使用3个图像).
阅读有关SpeedButton Glyph属性的文档.

