本文介绍了Autohotkey:删除窗口边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只想显示一些带有背景的文本.尽管我进行了尝试,但文字周围还是有很多空白.
I would like to display just some text with a background. Despite my attempts, there is a lot of empty space around the text.
Gui, +AlwaysOnTop -Border -SysMenu -Caption
Gui, Add, Text, , Some text
Gui, Show, AutoSize
WinSet, Style, -0xC00000, A
WinSet, Style, -0x40000, A
WinSet, ExStyle, -0x00000200, A
如果我手动设置尺寸而不是AutoSize
,则会剪切文本.
If, instead of AutoSize
, I manually set the size, the text is cut.
推荐答案
如果在文本上添加边框,即
If you add a border to the text, i.e.,
Gui Add, Text, Border, Some text
您会看到它确实是带有额外空间的窗口本身,而不是文本控件.默认情况下,如果在添加控件之前未给GUI提供空白,则选择一个与字体成比例.因此,在添加文本控件之前,只需将空白设置为零即可.
you'll see it is indeed the window itself with the extra space and not the text control. By default, if no margin is given to a GUI before a control is added it chooses one that is proportional to the font. So, just set the margin to zero before you add the text control:
Gui Margin, 0, 0
Gui Add, Text,, Some text
这篇关于Autohotkey:删除窗口边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!