gpt4 book ai didi

button - 如何去除按钮边框样式?

转载 作者:行者123 更新时间:2023-12-02 06:41:50 24 4
gpt4 key购买 nike

在autohotkey中,如何去掉按钮的黑色边框?我只想要一个没有任何边框的按钮。

我已经尝试了所有这些样式修饰符,但没有成功。

gui, add, button, hwndMyButton
Control, Style, -0x0,, ahk_id %MyButton% ;remove BS_PUSHBUTTON
Control, Style, -0x1,, ahk_id %MyButton% ;remove BS_DEFPUSHBUTTON
Control, Style, +0x8000,,ahk_id %MyButton% ;add BS_FLAT
Control, Style, +0x40,, ahk_id %MyButton% ;add BS_ICON

最佳答案

JoeDF 有一个很好的例子,但我不想添加这么大的库(它确实超出了我的需要。

所以,我只是使用了图片控件。

gui, add, picture h16 w16 vMyButton gMyProcedure, icon0, mydll

然后我写了一个很小的library called Mousey这会将光标变成手形,这样当鼠标经过它时用户就知道它是一个按钮。单击图标时很容易更改图标 - 因此您可以使用此过程来显示“按下”和“未按下”状态。

效果是我现在有了一个漂亮的“按钮”小图标。

;http://ahkscript.org/boards/viewtopic.php?p=48057#p48057
#SingleInstance, On
#NoEnv
SetBatchLines, -1
#include mousey.ahk

toggle := 0
gui, add, picture, h32 vIconButton hwndIconButton gtoggleicon icon45, shell32.dll
mouseycursor := mousey_init(IconButton,"hand")
gui, show
return

toggleicon:
if(toggle){
guicontrol,,IconButton, *icon45 shell32.dll
toggle := 0
}else{
guicontrol,,IconButton, *icon28 shell32.dll
toggle := 1
}
return

guiclose:
mousey_close(mouseycursor)
exitapp

关于button - 如何去除按钮边框样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30876233/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com