【问题标题】:unable to enter data in Input Control of a GUI in autoit无法在 autoit 的 GUI 的输入控件中输入数据
【发布时间】:2013-07-17 06:48:09
【问题描述】:

下面是我的代码。我无法在第二个输入控件中单击和编辑。

#include <GUIConstants.au3> 

$gui = GuiCreate("Hello World", 700, 600) 
$Label_HelloWorld = GuiCtrlCreateLabel("Path / Directory", 40, 20, 300, 18) 
$file = GUICtrlCreateInput("", 140, 20, 300, 20)

$Label_boot = GuiCtrlCreateLabel("path of boot.c", 40, 60, 300, 18) 
$file2 = GUICtrlCreateInput("", 140, 60, 300, 20)
$Button_OK = GuiCtrlCreateButton("CHECK", 400, 90, 50, 20)

GuiSetState(@SW_SHOW, $gui)
Sleep(10000)

【问题讨论】:

    标签: user-interface user-input autoit


    【解决方案1】:

    您的标签与控件 (again) 重叠,这次是水平方向。当输入向右 100px 时,宽度为 300px 意味着前 200px 是重叠的。如果您尝试单击输入的最后 100 像素,那么它将起作用。

    这很容易检查,只需使用 autoit 窗口信息工具并查看控件的轮廓即可。

    【讨论】:

    • 非常感谢您的解决方案
    • 只是一个站点注释:如果您使用的是常量字符串,则无需为标签指定宽度和高度。 GuiCtrlCreateLabel("Path / Directory", 40, 20) 创建一个足够宽和高的标签以显示给定的文本。
    猜你喜欢
    • 1970-01-01
    • 2022-01-18
    • 2011-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-27
    • 2020-12-01
    相关资源
    最近更新 更多