找回密码
 加入
搜索
查看: 1246|回复: 2

本人新手,想问一下如何获取GUI自身控件的属性,比如按扭的名称、大小等等

[复制链接]
发表于 2009-3-3 09:13:03 | 显示全部楼层 |阅读模式
我觉得AU3比VB方便多了。现在由VB转入AU3。
可是AU3控件属性跟VB写法不一样,
怎能在代码里写控件属性。
本人新手,想问一下如何获取自身控件的属性,比如按扭的名称、大小等等

[ 本帖最后由 leilin169 于 2009-3-4 10:03 编辑 ]
发表于 2009-3-4 02:11:28 | 显示全部楼层
这样?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 138, 86, 192, 114)
$Button1 = GUICtrlCreateButton("Button1", 24, 24, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $Pos = ControlGetPos("Form1", "", $Button1)
                        $Name = GUICtrlRead($Button1)
                        MsgBox(0, 0, "名字:" & $Name & @LF & "X:" & $Pos[0] & @LF & "Y:" & $Pos[1] & @LF & "宽度:" & $Pos[2] & @LF & "高度:" & $Pos[3])
        EndSwitch
WEnd
 楼主| 发表于 2009-3-4 10:03:05 | 显示全部楼层
非常感谢帮助!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 22:36 , Processed in 0.072509 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表