autohotkey groupbox里加控件
时间: 2023-07-30 19:08:08
浏览: 382
![ZIP](https://csdnimg.cn/release/download/static_files/pc/images/minetype/ZIP.png)
tooltip控件 groupBox控件
要在[autohotkey](https://wenku.csdn.net/doc/6469aeb1543f844488c1a7ea?spm=1055.2569.3001.10083)的[group](https://wenku.csdn.net/doc/34jc7ifwqo?spm=1055.2569.3001.10083)Box控件中添加其他控件,可以使用GroupBox的HWND句柄来创建和添加子控件。下面是一个示例代码,可以在GroupBox中添加一个Button控件:
Gui, Add, GroupBox, x10 y10 w200 h100, My GroupBox
Gui, Add, Button, x20 y40 w100 h30, My Button
hwnd := Win[exist](https://wenku.csdn.net/doc/6401abb8cce7214c316e9417?spm=1055.2569.3001.10083)() ; 获取GroupBox的HWND句柄
[control](https://wenku.csdn.net/doc/4zxi954drc?spm=1055.2569.3001.10083)GetPos, x, y, w, h, , ahk_id %hwnd% ; 获取GroupBox的位置和大小
ControlMove, Button1, x+30, y+60, w-60, h-80, , ahk_id %hwnd% ; 移动和调整Button的位置和大小
Gui, Show
[return](https://wenku.csdn.net/doc/6401ad15cce7214c316ee38b?spm=1055.2569.3001.10083)
在上面的代码中,我们首先创建了一个名为"My GroupBox"的GroupBox控件,并在其中添加了一个名为"My Button"的Button控件。然后,我们使用WinExist函数获取GroupBox的HWND句柄,并使用ControlGetPos函数获取GroupBox的位置和大小。最后,我们使用ControlMove函数将Button控件移动到GroupBox内部,并调整其位置和大小,以确保它位于GroupBox的中心位置。
当然,你也可以在GroupBox中添加其他类型的控件,只需要将Button控件替换为你需要的控件,并根据需要进行调整即可。
阅读全文
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![application/x-zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)