[You must be registered and logged in to see this link.]
จาก code ที่เอามาจากเวปหลัก เอามาทดสอบการย่อขยาย ได้แบบนี้
คำถามที่ คือ $WGP[3] ทำไมถึงต้องใช้เลข 3
จาก code ที่เอามาจากเวปหลัก เอามาทดสอบการย่อขยาย ได้แบบนี้
- Code:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $hGui, $ChkBox[1], $Msg, $WGP
$hGui = GUICreate("", 335, 50, -1, -1)
$ChkBox[0] = GUICtrlCreateCheckbox("ขยายขนาด GUI", 5, 5, 125, 15)
GUICtrlSetResizing(-1, BitOr($GUI_DOCKTOP, $GUI_DOCKLEFT, $GUI_DOCKSIZE)); <- Set the resizing for the control
GUISetState()
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $ChkBox[0]
$WGP = WinGetPos($hGui)
If GUICtrlRead($Msg) = $GUI_CHECKED Then
GUICtrlSetResizing(-1, BitOr($GUI_DOCKTOP, $GUI_DOCKLEFT, $GUI_DOCKSIZE)) ; <- Set the resizing for the control
WinMove($hGui, "", Default, Default, Default, $WGP[3] + 100)
Else
WinMove($hGui, "", Default, Default, Default, $WGP[3] - 100)
EndIf
EndSwitch
WEnd
คำถามที่ คือ $WGP[3] ทำไมถึงต้องใช้เลข 3