Code: Select all
Gui, +Resize
Gui, Add, Edit, x10, y10 w480 h180
Gui, Show, w500 h250
Code: Select all
Gui, +Resize
Gui, Add, Edit, x10, y10 w480 h180
Gui, Show, w500 h250
Code: Select all
; This script shows how to resize a control
#Requires AutoHotkey v1.1.33
Gui +Resize
Gui Font, s10
Gui Add, Edit, w480 h180 ved
Gui Show
Return
GuiSize(GuiHwnd, eventInfo, width, height) {
If (eventInfo != MINIMIZED := 1)
GuiControl Move, ed, % "w" width - 25 "h" height - 15
}
mikeyww wrote: ↑13 Mar 2023, 08:12Explained: GuiSizeCode: Select all
; This script shows how to resize a control #Requires AutoHotkey v1.1.33 Gui +Resize Gui Font, s10 Gui Add, Edit, w480 h180 ved Gui Show Return GuiSize(GuiHwnd, eventInfo, width, height) { If (eventInfo != MINIMIZED := 1) GuiControl Move, ed, % "w" width - 25 "h" height - 15 }
Code: Select all
#Requires AutoHotkey v1.1.36+
Gui, +Resize
Gui, Add, Edit, x10 y10 w480 h180 +HWNDhwnd
Gui, Show, w500 h250
Return
GuiSize:
ControlMove, , , , A_GuiWidth - 10, A_GuiHeight - 60, ahk_id %hwnd%
Return
GuiClose:
ExitApp
Code: Select all
; This script moves GUI controls when the GUI is resized.
#Requires AutoHotkey v1.1.33
Gui +Resize
Gui Font, s10
Gui Add, Edit , w480 h180 ved
Gui Add, Progress, wp h20 vprog cBlue, 100
Gui Show
Return
GuiSize(GuiHwnd, eventInfo, width, height) {
If (eventInfo != MINIMIZED := 1) {
GuiControl Move, ed , % "w" width - 25 "h" height - 40
GuiControl Move, prog, % "w" width - 25 "y" height - 27
}
}
Code: Select all
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶
Gui, Font, s12 w567 c000000, Segoe UI
Gui, Add, Text, x30, Progressing...
Gui, Add, Progress, x10 y+1 w160 h10 cBLUE Background000000 Range1-48 vMyProgress
Gui, Font, s9 w300 cRED, Segoe UI
Gui, Add, Text, x30 Y+1, Other Text as example.
gui, show
GuiControl,, MyProgress, 0
Loop, 48
{
GuiControl,, MyProgress, +1
Sleep, 16
}
Sleep 750
SoundBeep, 1200, 200
SoundBeep, 1250, 100
Gui, Destroy
; ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶ ̶
Return
You saw no changes when removing ved because you did not resize the GUI, and you did not attempt to retrieve the control's value (contents).V: Variable. Associates a variable with a control. Immediately after the letter V, specify the name of a global variable (or a ByRef local that points to a global, or [in v1.0.46.01+] a static variable). For example, specifying vMyEdit would store the control's contents in the variable MyEdit whenever the Gui Submit command is used. If a control is not input-capable -- such as a Text control or GroupBox -- associating a variable with it can still be helpful since that variable's name serves as the control's unique identifier for use with the ControlID parameter of GuiControl and GuiControlGet, and with A_GuiControl.
Code: Select all
#Requires AutoHotkey v1.1.33
Gui +Resize
Gui Font, s10
Gui Add, Edit , w480 h180 ved
Gui Add, Progress, x0 wp h55 vprog cBlue, 100
Gui, Font, s12
Gui Add, Text, x10 vte, hello
Gui Show
Return
GuiSize(GuiHwnd, eventInfo, width, height) {
If (eventInfo != MINIMIZED := 1) {
GuiControl Move, ed , % "w" width - 25 "h" height - 65
GuiControl Move, prog, % "w" width - 0 "y" height - 40
GuiControl Move, te, % "y" height -40
}
}
mikeyww wrote: ↑13 Mar 2023, 09:49Code: Select all
; This script moves GUI controls when the GUI is resized. #Requires AutoHotkey v1.1.33 Gui +Resize Gui Font, s10 Gui Add, Edit , w480 h180 ved Gui Add, Progress, wp h20 vprog cBlue, 100 Gui Show Return GuiSize(GuiHwnd, eventInfo, width, height) { If (eventInfo != MINIMIZED := 1) { GuiControl Move, ed , % "w" width - 25 "h" height - 40 GuiControl Move, prog, % "w" width - 25 "y" height - 27 } }