GUI setting problem v2 Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
fwejifjjwk2
Posts: 89
Joined: 10 Aug 2019, 01:49

GUI setting problem v2

23 Apr 2020, 07:34

I want hide this.
111111.png
111111.png (3.28 KiB) Viewed 1362 times

Code: Select all

gui_main()
{
main_gui := GuiCreate()
main_hwnd := main_gui.hwnd
ref_main := main_gui.Add("Edit", "xm vMyEdit w220 h30", "")
MainBut := main_gui.Add("Button", "x+1 yp w0 Default" ,"Default Hidden")
main_gui.Opt("+AlwaysOnTop -caption") 
main_gui.OnEvent("Escape",(this) => this.Hide())
main_gui.Show(NoHide)
}

t::gui_main()

And how to setting +Owner when main_gui Submit hide and open second gui below main_gui.
Right now I use function avtive second gui. I wonder maybe have orther method.
Last edited by fwejifjjwk2 on 23 Apr 2020, 08:28, edited 2 times in total.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: GUI setting problem v2

23 Apr 2020, 07:42

Code: Select all

-VScroll
edit option
fwejifjjwk2
Posts: 89
Joined: 10 Aug 2019, 01:49

Re: GUI setting problem v2

23 Apr 2020, 08:14

@swagfag thank you.
But I got error in v2.

Code: Select all

Specifically: vscroll

Code: Select all

; bug
gui_main()
{
main_gui := GuiCreate()
ref_main := main_gui.Add("Edit", "xm vMyEdit w220 h30", "")
MainBut := main_gui.Add("Button", "x+1 yp w0 Default" ,"Default Hidden")
main_gui.Opt("+AlwaysOnTop -caption -VScroll")
main_gui.OnEvent("Escape",(this) => this.Hide())
main_gui.Show(NoHide)
}

t::gui_main()

HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: GUI setting problem v2  Topic is solved

23 Apr 2020, 11:37

The option is for control, not Gui!

Code: Select all

gui_main()
{
main_gui := GuiCreate()
ref_main := main_gui.Add("Edit", "xm vMyEdit w220 h30 -vscroll", "")
MainBut := main_gui.Add("Button", "x+1 yp w0 Default" ,"Default Hidden")
main_gui.Opt("+AlwaysOnTop -caption")
main_gui.OnEvent("Escape",(this) => this.Hide())
main_gui.Show(NoHide)
}

t::gui_main()
fwejifjjwk2
Posts: 89
Joined: 10 Aug 2019, 01:49

Re: GUI setting problem v2

23 Apr 2020, 12:06

@HotKeyIt Thanks a lot.
By the way I didn't understand the orther option like "xm" "r2" "x+1" "yp"
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: GUI setting problem v2

23 Apr 2020, 12:23

xm - one "Gui.MarginX"-length away from the left window edge
r2 - enough height to accommodate 2 rows worth of text
x+1 - one pixel away from where the last added control ends
yp - same y as the last added control

but all of this is better explained in the docs so u should go read them
fwejifjjwk2
Posts: 89
Joined: 10 Aug 2019, 01:49

Re: GUI setting problem v2

23 Apr 2020, 12:56

@swagfag
Thanks again.
In my script use "r2" will get something wrong. "r1" is fine but "r2" seens make search failure.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: GUI setting problem v2

23 Apr 2020, 16:02

why, whats wrong?
fwejifjjwk2
Posts: 89
Joined: 10 Aug 2019, 01:49

Re: GUI setting problem v2

23 Apr 2020, 16:36

@swagfag
Nothing. We can use option -WantReturn solve this problem.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Draken and 67 guests