Is it possible to open a GUI window via a link control? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
afe
Posts: 615
Joined: 06 Dec 2018, 04:36

Is it possible to open a GUI window via a link control?

19 Jun 2019, 12:10

Hello,

I want to open the GUI window with a link instead of a button. Is this achievable?
Just like the "Option" of IE's View Downloads .
Thanks.

Image
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Is it possible to open a GUI window via a link control?

19 Jun 2019, 12:25

If you're talking about launching a gui you made from another gui that you made, then yes.
it's super easy barely an inconvenience.


Here is a simple example. You can get fancy with having the "Options" text change color when you mouse over it too. (requires a bit more effort, but not at all hard to do).

Code: Select all


#SingleInstance,Force


Gui,1:+AlwaysOnTop  -Dpiscale
Gui,1:Color,F0F0F0
Gui,2:+Parent1 -Caption
Gui,2:Color,FFFFFF
Gui,2:Add,Button,x220 y28 w60 h24 -Theme +E0x20,Run
Gui,2:Add,Progress,x10 y20 w280 h40 cD1E8FF BackgroundB1D6FA,100
Gui,2:Add,Text,x20 y30 h20 0x200  Backgroundtrans,Blah Blah Blah
Gui,1:Font,c336699 s10 Bold,Segoe UI
Gui,1:Add,Text,x10 y160 h30 0x200 gExtrGui,Options
Gui,1:Font,norm,
Gui,1:Add,Button,x160 y165 h24 ,Clear List
Gui,1:Add,Button,x+10 y165 h24 ,Close
Gui,1:Show,w300 h200
Gui,2:Show,x0 y0 w300 h150

return
GuiClose:
GuiContextMenu:
*ESC::
	ExitApp
	
	
	

ExtrGui(){
	Gui,3:Destroy
	Gui,3:+Owner1
	Gui,3:Show,w500 h200,
}

afe
Posts: 615
Joined: 06 Dec 2018, 04:36

Re: Is it possible to open a GUI window via a link control?

20 Jun 2019, 00:27

I may not be able to say clearly, you misunderstood what I meant. I don't mean to simulate the IE View Downloads window, but its Option.
This Option is a hyperlink that will open a window when clicked. I want to know if AHK can do similar functions.

You seem to be implementing it through the g-Label of the Text control, right?
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Is it possible to open a GUI window via a link control?

20 Jun 2019, 02:22

afe wrote:
20 Jun 2019, 00:27
You seem to be implementing it through the g-Label of the Text control, right?
Yes that's correct.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Is it possible to open a GUI window via a link control?

20 Jun 2019, 02:51

afe wrote:
19 Jun 2019, 12:10
Hello,

I want to open the GUI window with a link instead of a button. Is this achievable?
Just like the "Option" of IE's View Downloads .
Thanks.

Image
You might want to download AutoGUI. Select "New GUI", and then where there is "Control Types", select the "Link" control. AutoGUI is just fun to play with, to help you with your GUI design.

AutoGUI
Note- written in the AutoHotkey language.
https://sourceforge.net/projects/autogui/

If you then want something more customized, then you might want to refer to Hellbent's YouTube channel, which is under the name CivReborn. Search for GUI or custom GUI videos.
https://www.youtube.com/user/CivReborn/videos

Edit- wolf_II gave a good example. My suggestion was for you to see it and play with the design so that it's what you want.
Last edited by SOTE on 20 Jun 2019, 04:17, edited 1 time in total.
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: Is it possible to open a GUI window via a link control?  Topic is solved

20 Jun 2019, 03:30

use Gui, Add, Link

Code: Select all

Gui, -MinimizeBox
Gui, Margin, 50, 30
Gui, Add, Link, gMySubroutine, <a>Options</a>
Gui, Show
return

MySubroutine:
    MsgBox do whatever
    Gui, New,, Gui #2
    Gui, Show, w300 h200
return
afe
Posts: 615
Joined: 06 Dec 2018, 04:36

Re: Is it possible to open a GUI window via a link control?

20 Jun 2019, 22:05

wolf_II wrote:
20 Jun 2019, 03:30
use Gui, Add, Link
Thank you. The only difference is that the AHK link will always display an underscore instead of being displayed when the mouse is over it.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, mebelantikjaya, ThePeter and 241 guests