在同一行打印速度按钮和按钮标题的最简单方法
我的应用程序中有一个屏幕,其中连续有 5 个按钮,其中一个是速度按钮,几乎仅用于样式。它们的高度和宽度相同,但速度按钮打印 1 个像素。这真的让我很恼火,因为这个屏幕是我们的用户一直看到的。在 Delphi 2009 中,我相信按钮有一个边距选项,Delphi 7 中有一个边距,但它只改变左边距。 Delphi 7有办法解决这个问题吗?我是否错误地重新调整了速度按钮的用途?
请注意,这不是一个技巧面试问题,尽管听起来像是这样,请重新穿上靴子。
There's a screen in my app where I've got 5 buttons in a row, one of them is a speed button which is pretty much just used for style. They are identical height and width but the speed button prints down 1 pixel. This really irks me as this screen is something our users see all the time. In Delphi 2009 I believe there is a margin option for buttons, there is a margin in Delphi 7 but it only changes the left margin. Is there a Delphi 7 way to fix this problem? Am I erroneously re-purposing the speedbutton?
Note, this is not a trick interview question even though it sounds like it, put your boots back on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,
Margin
属性确实会更改TSpeedButton
标题的左边距,但前提是Layout
属性设置为blGlyphLeft
,默认设置为。将
Layout
更改为blGlyphTop
或blGlyphBottom
,您将能够相应地调整标题的顶部或底部边距。Yes, the
Margin
property does change the left margin of aTSpeedButton
's caption, but only when theLayout
property is set toblGlyphLeft
, which it is set to by default.Change
Layout
to eitherblGlyphTop
orblGlyphBottom
, and you will be able to adjust, correspondingly, the top or the bottom margin of the caption.如果五个按钮并排在一起,用户会期望它们都以一致的方式工作。我建议不要将 TButton 和 TSpeedButton 混合在同一组中。将 TSpeedButton 替换为 TButton,然后单独处理样式问题(无论是什么)。
With five buttons in a row together, trhe user would expect that they all work in a consistent manner. I would counsel against mixing TButtons and TSpeedButtons in the same group. Replace the TSpeedButton with a TButton, and then deal with the style issue (whatever that is) separately.