找回密码
 加入
搜索
查看: 12818|回复: 29

[AU3基础] ControlMove问题,怪事,怎么出现两个

 火.. [复制链接]
发表于 2014-6-16 23:28:18 | 显示全部楼层 |阅读模式
本帖最后由 qsy666888 于 2014-6-16 23:57 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 428, 399)
Global $Button1 = GUICtrlCreateButton("Button1", 304, 96, 75, 25)
Global $Group1 = GUICtrlCreateGroup("", 56, 144, 185, 177)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
Global $Button2 = GUICtrlCreateButton("Button2", 80, 176, 99, 25)
Global $Label1 = GUICtrlCreateLabel("Label1", 104, 224, 52, 24)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        ControlMove($Form1,"",$Group1 , 56, 50)
        EndSwitch
WEnd

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-6-17 00:12:53 | 显示全部楼层
GUICtrlCreateGroup  你移动只是这控件不是一组!我以前也是一样!在GUI界面编辑可以移动!
但是在代码移动的时候要把里面的全部移动!要不会就出现你这种假像了! GUICtrlCreateGroup 控件移动了但里面一起的是不会移动的!
 楼主| 发表于 2014-6-17 00:35:24 | 显示全部楼层
本帖最后由 qsy666888 于 2014-6-17 00:37 编辑

回复 2# f4李文杨

一起移动是对的,只是移动了,在原来的位置还有相同的控件,我要做到的是移动全部控件。
发表于 2014-6-17 02:38:26 | 显示全部楼层
参与一下,不做杰斯
发表于 2014-6-17 09:41:59 | 显示全部楼层
原来控件还可以这样整体移动的啊!真是学习了。
 楼主| 发表于 2014-6-17 09:47:25 | 显示全部楼层
本帖最后由 qsy666888 于 2014-6-17 09:49 编辑

回复 5# 水木子
你不要取笑我了。我都不好意思了,就是没有弄得出来,才发出来找你们这些大侠看看是怎么回事?
发表于 2014-6-17 10:22:29 | 显示全部楼层
我还从来没有尝试过,将多个控件分组,再将组整体移动,你这思路倒是挺不错的。
 楼主| 发表于 2014-6-17 10:38:18 | 显示全部楼层
回复 7# 水木子
可能我的思路是错的,实现的目标就是想整体移动
发表于 2014-6-17 10:58:48 | 显示全部楼层
回复 1# qsy666888

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 428, 399)
Global $Button1 = GUICtrlCreateButton("Button1", 304, 16, 75, 25)
Global $Button3 = GUICtrlCreateButton("Button3", 304, 46, 75, 25)
Global $Group1 = GUICtrlCreateGroup("", 26, 74, 185, 177)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
Global $Button2 = GUICtrlCreateButton("Button2", 50, 106, 99, 25)
Global $Label1 = GUICtrlCreateLabel("Label1", 74, 154, 52, 24)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        ControlMove($Form1,"",$Group1 , 206, 74)
                                                ControlMove($Form1,"",$Button2 , 231, 106)
                                                ControlMove($Form1,"",$Label1 , 260, 154)
                                Case $Button3
                        ControlMove($Form1,"",$Group1 , 26, 174)
                                                ControlMove($Form1,"",$Button2 , 50, 206)
                                                ControlMove($Form1,"",$Label1 , 74, 250)                                               
        EndSwitch
WEnd
 楼主| 发表于 2014-6-17 11:36:04 | 显示全部楼层
回复 9# chzj589
昨天我也像你这样弄了,居然没有成功,我不得不佩服你。
 楼主| 发表于 2014-6-17 11:49:50 | 显示全部楼层
回复 9# chzj589
还是有点问题,不知道是不是版本的问题,我的是这样

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-6-17 11:55:40 | 显示全部楼层
呵呵!看样子还是得单个操作。
发表于 2014-6-17 12:12:58 | 显示全部楼层
回复 11# qsy666888
坐标问题,我又试了一下,$Button1跟$Button2不会,转$Button3就又出现问题

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 428, 399)
GUISetBkColor(0xECE9D8)
Global $Button1 = GUICtrlCreateButton("Button1", 304, 16, 75, 25)
Global $Button3 = GUICtrlCreateButton("Button3", 304, 46, 75, 25)
Global $Group1 = GUICtrlCreateGroup("", 26, 74, 185, 177)
        GUICtrlSetBkColor(-1, 0xECE9D8); 背景色
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
Global $Button2 = GUICtrlCreateButton("Button2", 50, 106, 99, 25)
Global $Label1 = GUICtrlCreateLabel("Label1", 74, 154, 52, 24)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        ControlMove($Form1,"",$Group1 , 206, 74)
                                                ControlMove($Form1,"",$Button2 , 230, 106, 99, 25)
                                                ControlMove($Form1,"",$Label1 , 254, 153)
                                Case $Button2
                        ControlMove($Form1,"",$Group1 , 26, 74, 185, 177)
                                                ControlMove($Form1,"",$Button2 , 50, 106, 99, 25)
                                                ControlMove($Form1,"",$Label1 , 74, 153, 52, 24)                                               
                                Case $Button3
                        ControlMove($Form1,"",$Group1 , 26, 184)
                                                ControlMove($Form1,"",$Button2 , 50, 216, 99, 25)
                                                ControlMove($Form1,"",$Label1 , 74, 260)                                               
        EndSwitch
WEnd
 楼主| 发表于 2014-6-17 12:23:12 | 显示全部楼层
回复 13# chzj589

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-6-17 12:25:54 | 显示全部楼层
回复 14# qsy666888
点$Button1跟$Button2就不会
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-18 16:48 , Processed in 0.085549 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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