Page 1 of 1

Adding a web link to a dialog

Posted: Wed Sep 01, 2010 8:07 am
by boaz
Hi,

I saw in the help topic that a Label can act as a link, but I couldn't find out how to do it.

I want to place a link to the web on my dialog, how do I do it?

Thanks,
Boaz

Re: Adding a web link to a dialog

Posted: Wed Sep 01, 2010 8:34 pm
by mills
The documentation may be misleading. However, you could make it work for a label to work as an html link.

Create your GUI with the label you want to have a link. Double-click on the label in the designer.
Set 'Performs Action' to 'Return from Dialog':

link_label.jpg
link_label.jpg (106.49 KiB) Viewed 22401 times


Code: Select all

label: clicklink
Set Variable test to
Display Dialog: clicklink, wait for dialog to return (modal)
if Variable test Equals LABEL1
    Comment: Launch web link
  GoTo Label: clicklink
end


So, you'll have to figure out how to "launch the web link"

I tried using MSIcode 'Run Program' with "start http://link" but it wasn't working. You might be able to get 'Run Program As' to work.

Alternatively, you may need to look up the default web browser in Registry and use that to launch your link.

Re: Adding a web link to a dialog

Posted: Thu Sep 02, 2010 1:27 am
by boaz
Thanks for your help :)

The problem is that I have 2 dialogs inside a wizard loop.
I can't set a label for some reason inside the loop.
and any way when I put the label outside it doesn't work...
I added a label called 'PrivacyClickedLabel' inside the dialog, and set it to 'return from dialog'

I attach my code:

Code: Select all

label: WelcomeLabel
wizard loop
Set Variable IsPrivacyClicked to
Display Dialog: welcome, wait for dialog to return (modal)
if Variable IsPrivacyClicked Equals PrivacyClickedLabel
  Run Program $PROGRAMFILES$\internet explorer\iexplore.exe http://gamebox.my-quick-search.com/privacy.aspx
  GoTo Label: WelcomeLabel
end
Display Dialog: wizard, wait for dialog to return (modal)
GoTo Label: Main Install
end


any idea??

Thanks.

Re: Adding a web link to a dialog

Posted: Thu Sep 02, 2010 11:19 am
by HAHNmediaservice
We have this working, here an example:

Assumed the name of your dialog is MYDIALOG. Put a BUTTON on the dialog, give the property name MYLINK. Doubleclick the button, select tab "Object Behavior", select the button in the "Control" drop-down and give as "Performs Action" = "Return from Dialog". Then in your code do the following:

Code: Select all

Display dialog: MYDIALOG, wait for dialog to return (modal)
if Variable WIZARD Equals MYLINK
    Run Program http://www.hahn-mediaservice.de
    GoTo Label: MYDIALOG
end

On clicking the button the default web-browser should open and navigate to http://www.hahn-mediaservice.de AND return to the dialog itself.

Instead of the button you could also use the image control without using an image (because this is transparent, we do this). Give the image control the property name MYLINK and it works the same way. Put the image control where ever you want ... over an image, over text, anywhere you like to.

P.S.: Never use "...\internet explorer\iexplore.exe" because (a) you are not sure if this browser is installed on the target maschine and (b) you are not sure if this browser is the users default.

Kind regards!

Re: Adding a web link to a dialog

Posted: Mon Apr 16, 2012 2:46 am
by mikKummerfeld
Thank you so much :)

Danke, hat mir sehr geholfen :) Schade, dass es nicht mit Labels (inkl. Hovereffekt) funktioniert :(