Topic: Insert web site link

How to insert to form a  link to my website?
Thanks in advance.

Re: Insert web site link

Hello Zlaya

procedure Form1_Image6_OnClick (Sender: string);
begin
   OpenURL(Form1.Edit1.Text);
end;

JB

Re: Insert web site link

procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
    OpenURL('https://translate.google.it/?hl=it&tab=wT');
end;

Domebil

Re: Insert web site link

This is my first project.
Where to put this code?

Re: Insert web site link

Hi,
Please have a look at the attached project and the 2 screenshots that are included.
Screenshot1.
1.  click on the 'script' icon to enable scripting.
2.  this will create an 'events tab'
3.  highlight the object on the form you want to use (it can be any object - the form itself, a label, a text box, a button, an image etc)
4.  triple-click on the 'event' in the 'events tab' that you want to associate with the object (in this example 'onclick' of 'button1')
This will now take you to the script editor.
Screenshot 2.
2.  an empty procedure is automatically created for you.  Insert whatever code you need between  'begin' and 'end' for that procedure..
3.  anything else that gets automatically created at the same time (for example, the 'hello world' example) can be deleted EXCEPT the final 'begin' and end' which is ALWAYS needed.
Regards,
Derek.

Post's attachments

Attachment icon zlaya.zip 585.74 kb, 384 downloads since 2020-05-11 

Re: Insert web site link

Hi, Derek,
Thank you very much.
Now is OK.
Regards
Zlaya