【问题标题】:Autohotkey GUI buttons changed size on a different PCAutohotkey GUI 按钮在不同的 PC 上改变了大小
【发布时间】:2018-04-19 11:29:05
【问题描述】:

我对自动热键的这方面不太熟悉。不久前,我编写了一个在我的笔记本电脑和扩展坞监视器上都可以使用的 GUI。最近我用一个更大的显示器替换了我现有的显示器。现在我的按钮对于文本来说显得太小了,并且窗口的位置还有一些其他的变化。

我希望我的 GUI 能够在笔记本电脑本身和对接时正常工作。

另外请解释一下是什么原因造成的。

【问题讨论】:

    标签: user-interface screen autohotkey monitor


    【解决方案1】:

    一些例子。

    Gui, Add, Button, gButtons vButton1, Button1  |  auto position and size
    Gui, Add, Button,y+40 gButtons vButton2, Button 2  |  y is relative to Button1 +40 ;same x as Button1
    Gui, Add, Button,x+60 gButtons vButton3, Button 3  |  x is relative to Button2 +60 ;same y as Button2
    Gui, Add, Button, x200 y200 gButtons vButton4, Button 4  |  Fixed position x=200 y=200
    Gui, Add, Button, x15 y250 w200 h60 gButtons vButton5, Button 5  |  Fixed position, width and hight
    Gui, Add, Button, y+20 wp+100 hp-30 gButtons vButton6, Button 6  |  Relative y, width and hight to button 5 width increased +100 and h decreased by 30
    Gui, Add, Button, y+20 wp hp gButtons vButton7, Button 7  |  Relative y, and same width and hight as button 5
    Gui, Add, Button, y+20 wp w150 h30 gButtons vButton8, Button 8  |  Mistake too much text and w and h are fixed and too small
    Gui, Add, Button,x+10 gButtons vButton9, Button 9 |  A lot of text but w`nand h are not fixed ;if you dont put new line it would all go in 1 line
    Gui,Add,Button,x240 y480 gGuiClose,Exit
    Gui, Show, w500 h500
    return
    
    GuiClose:
    ExitApp
    
    Buttons:
    return
    

    有关控件的定位和大小的更多信息 https://autohotkey.com/docs/commands/Gui.htm#PosSize

    【讨论】:

    • 感谢您提供的信息。我不知道那件事。不幸的是,这些都不适用于我的问题,因为每个 X 和 Y、H 和 W 都是固定的。但是新显示器上的按钮似乎太小了。
    • 尝试删除 H 和 W 的固定值,看看是否有帮助。那么无论使用哪个显示器,按钮的大小都应该与正确显示文本所需的一样大。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多