ControlMove问题,怪事,怎么出现两个
本帖最后由 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
GUICtrlCreateGroup你移动只是这控件不是一组!我以前也是一样!在GUI界面编辑可以移动!
但是在代码移动的时候要把里面的全部移动!要不会就出现你这种假像了! GUICtrlCreateGroup 控件移动了但里面一起的是不会移动的! 本帖最后由 qsy666888 于 2014-6-17 00:37 编辑
回复 2# f4李文杨
一起移动是对的,只是移动了,在原来的位置还有相同的控件,我要做到的是移动全部控件。 参与一下,不做杰斯 原来控件还可以这样整体移动的啊!真是学习了。 本帖最后由 qsy666888 于 2014-6-17 09:49 编辑
回复 5# 水木子
你不要取笑我了。我都不好意思了,就是没有弄得出来,才发出来找你们这些大侠看看是怎么回事? 我还从来没有尝试过,将多个控件分组,再将组整体移动,你这思路倒是挺不错的。 回复 7# 水木子
可能我的思路是错的,实现的目标就是想整体移动 回复 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 回复 9# chzj589
昨天我也像你这样弄了,居然没有成功,我不得不佩服你。 回复 9# chzj589
还是有点问题,不知道是不是版本的问题,我的是这样 呵呵!看样子还是得单个操作。 回复 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 回复 13# chzj589 回复 14# qsy666888
点$Button1跟$Button2就不会
页:
[1]
2