Code: Select all
p::
Gui, New, +AlwaysOnTop +Border, ALERT
Gui, Add, Picture,, Seel.png
Gui, Font, S15
Gui, Add, Text, +center , Hello darkness my old friend
Gui, Font, S20
Gui, Add, Button, Default, OK
Gui, Show, Center
return
Code: Select all
p::
Gui, New, +AlwaysOnTop +Border, ALERT
Gui, Add, Picture,, Seel.png
Gui, Font, S15
Gui, Add, Text, +center , Hello darkness my old friend
Gui, Font, S20
Gui, Add, Button, Default, OK
Gui, Show, Center
return
Thanks anyway. I wanted a resizable gui where the controls always stayed in the center I thought there was an easier way out.BoBo wrote: Position
x := GuiWidth/2+ControlWidth/2 ; these are no valid AHKvars
y := GuiHeight/2+ControlHeight/2 ; these are no valid AHKvars
Code: Select all
Gui, +hwndGUI +AlwaysOnTop +Resize
Gui, Margin,0,0
Gui, Add, button, w100 h50 hwndBTN, Button
Gui, show, w150 h100
return
GuiSize:
gui, Submit, NoHide
WinGetPos,x,y,w,h, % "Ahk_id" GUI
ControlGetPos,cx,cy,cw,ch,, % "Ahk_id" BTN
SysGet, cyborder, 8
SysGet, sizeframe, 33
SysGet, title, 31
GuiControl, move, % BTN, % "x" w/2-(cw/2+sizeframe) "y" h/2-(ch/2+title-cyborder)
return
Users browsing this forum: No registered users and 122 guests