开发者

Easiest way to print caption of Speedbutton and Button on the same line

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 margi开发者_如何学Pythonn. 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.


Yes, the Margin property does change the left margin of a TSpeedButton's caption, but only when the Layout property is set to blGlyphLeft, which it is set to by default.

Change Layout to either blGlyphTop or blGlyphBottom, and you will be able to adjust, correspondingly, the top or the bottom margin of the caption.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜