here I used always x y w h ( with percent calculation , depending screensize , Example x:=(wa*50)/xx means x-position from GUI should be in the middle of screen
or just can add , as example : Gui,add,button ,x100 y200 w100 h30 gA1 ,OK ;- here gA1 is the label A1 , the x and y-position is inside the GUI
Code: Select all
Gui,1:default
wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
Gui,1: -DPIScale
color=D4D0C8
Gui,1:Color,Black,%color%
Gui,1:font,s12 cBlack,Lucida Console
x:=(wa*1)/xx,y:=(ha*1)/xx
Gui,Add, Text , x%x% y%y% , Booking type:
x:=(wa*1)/xx,y:=(ha*3)/xx,w:=(wa*15)/xx,h:=(ha*15)/xx
Gui,Add, DropDownList, x%x% y%y% w%w% h%h% vPM , Pakkerejse|Flybillet
x:=(wa*17)/xx,y:=(ha*3)/xx,w:=(wa*3)/xx,h:=(ha*2.4)/xx
Gui,Add, Button , x%x% y%y% w%w% h%h% gA1, OK
x:=(wa*10)/xx,y:=(ha*10)/xx,w:=(wa*25)/xx,h:=(ha*10)/xx
Gui,Show,x%x% y%y% w%w% h%h% ,Travel booking
GuiControl,1: Choose,PM,1
return
;------------
Guiclose:
Exitapp
;------------
A1:
Gui, Submit,nohide
If (Pm = "Pakkerejse")
gosub,2ndgui
Return
;--------------
2ndGUI:
wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
Gui,2: -DPIScale
color=D4D0C8
Gui,2:Color,Black,%color%
Gui,2:font,s12 cYellow,Lucida Console
;--
x:=(wa*1 )/xx,y:=(ha*1)/xx
Gui, 2:Add, Text ,x%x% y%y% , Afrejsedato
x:=(wa*1 )/xx,y:=(ha*3)/xx,w:=(wa*25)/xx,h:=(ha*25)/xx
Gui, 2:Add, MonthCal ,x%x% y%y% w%w% h%h% vStartCal
x:=(wa*28)/xx,y:=(ha*1)/xx
Gui, 2:Add, Text ,x%x% y%y% , Hjemrejsedato
x:=(wa*28)/xx,y:=(ha*3)/xx,w:=(wa*25)/xx,h:=(ha*25)/xx
Gui, 2:Add, MonthCal ,x%x% y%y% w%w% h%h% vEndCal
x:=(wa*1 )/xx,y:=(ha*30)/xx
Gui, 2:Add, Text ,x%x% y%y% , Fra lufthavn:
x:=(wa*8 )/xx,y:=(ha*30)/xx,w:=(wa*10)/xx,h:=(ha*2.5)/xx
Gui, 2:Add, Edit ,x%x% y%y% w%w% h%h% cBlack vPR1 , Københavns Lufthavn
x:=(wa*20)/xx,y:=(ha*30)/xx,w:=(wa*4)/xx,h:=(ha*2.5)/xx
Gui, 2:Add, Button ,x%x% y%y% w%w% h%h% gA2 , OK
x:=(wa*10)/xx,y:=(ha*23)/xx,w:=(wa*55)/xx,h:=(ha*45)/xx
Gui, 2:Show,x%x% y%y% w%w% h%h% , Package deal
return
;------------
2GuiClose:
Gui,2:destroy
return
;exitapp
;------------
A2:
Gui, 2:Submit,nohide
msgbox,START=`n%startcal%`n`nEND=`n%endcal%`n`n%pr1%
return
;=========================================================================