WIN32:有没有办法让按钮图标(BM_SETIMAGE)在文本的右侧

WIN32: Is there a way to have the button icon (BM_SETIMAGE) on the right side of the text

有没有办法让按钮带有文本和图形,图形位于文本的右侧,而无需所有者绘制按钮?

我只想发送 BM_SETIMAGE 以及其他任何需要的内容,因此图形位于文本的右侧。

此外,我注意到图像与文字的对比太紧,看起来不太好。有没有办法调整边距而不必在文本中使用空白 space?

Is there a way to have a button with text and graphic, with the graphic on the right side of the text, without having to owner-draw the button?

BS_LEFTTEXTBS_RIGHTBUTTON 样式可用,但文档说它们仅适用于复选框和单选按钮:

Constant Description
BS_LEFTTEXT Places text on the left side of the radio button or check box when combined with a radio button or check box style. Same as the BS_RIGHTBUTTON style.
BS_RIGHTBUTTON Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style.

对于标准按钮,除了通过所有者绘图之外,似乎没有其他方法可以控制图像的位置。

Is there a way to adjust the margin without having to use a blank space in the text?

使用BCM_SETTEXTMARGIN/Button_SetTextMargin():

Sets the margins for drawing text in a button control.