Responsive GUI Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Johana
Posts: 189
Joined: 02 May 2017, 02:34

Responsive GUI

02 Feb 2018, 10:25

Is there a possibility to use percentage or make a GUI scaleable to become responsive? We're sitting o different sizes of screens. Sometimes on Laptops, sometimes 32" sometimes on 21" and so on. And to make it more complex, some have the default 125% zoom and some have 100 and otherds 150%. If I make a gui that fits perfetly on my screen, it will be too big or small on others. Suggestions?
Osprey
Posts: 453
Joined: 18 Nov 2017, 05:50

Re: Responsive GUI  Topic is solved

02 Feb 2018, 17:46

Have you tried using the built-in A_ScreenWidth and A_ScreenHeight variables?

Code: Select all

GuiWidth := A_ScreenWidth*0.50
GuiHeight := A_ScreenHeight*0.50

Gui, New
Gui, Show, W%GuiWidth% H%GuiHeight%
Return

GuiClose:
  ExitApp
Return
Replace "50" on each of the first two lines with the percentages that you actually want.
Johana
Posts: 189
Joined: 02 May 2017, 02:34

Re: Responsive GUI

07 Feb 2018, 05:27

Osprey wrote:Have you tried using the built-in A_ScreenWidth and A_ScreenHeight variables?

Code: Select all

GuiWidth := A_ScreenWidth*0.50
GuiHeight := A_ScreenHeight*0.50

Gui, New
Gui, Show, W%GuiWidth% H%GuiHeight%
Return

GuiClose:
  ExitApp
Return
Replace "50" on each of the first two lines with the percentages that you actually want.
Didn't know that existed. Thank yoU!
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Responsive GUI

07 Feb 2018, 05:45

If you using resizeable Gui's, the build in GuiSize label creates A_ScreenWidth and A_ScreenHeight.
Use +resize option like below

Code: Select all

Gui, Caption +Resize
...
GuiSize:
msgbox % "A_ScreenWidth " A_ScreenWidth  "`n`nA_ScreenHeight " A_ScreenHeight
return
Einfach nur ein toller Typ. :mrgreen:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: cjsmile999 and 359 guests