⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 internet.htm

📁 对于学习很有帮助
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>UDDF - HTML/INTERNET</TITLE>
<META NAME="Description" CONTENT="HTML/INTERNET section of the Delphi Developers FAQ" >
<META NAME="KeyWords" CONTENT="" >

</HEAD>

<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff">

<CENTER>
<IMG SRC="../images/uddf.jpg"> </CENTER>

<P><HR SIZE=6 color="#00FF00"></P>
<FONT FACE="Arial Black" SIZE=7 COLOR="#ff0000"><P ALIGN="CENTER">HTML/INTERNET</FONT> </P>

<P><H1><A NAME="internet0">How to create a "hot link" in About box<IMG SRC="../images/new.gif" WIDTH=28 HEIGHT=11 BORDER=0 ALT=" [NEW]"></P></A></H1>


<PRE>Recently I have seen an interesting effect in some programs. You know,
almost every program has an About box, and within that there is a plain WWW
address like "http://www.somewhere.com". When I move the mouse over that
address, it suddently turns blue and  become a hotlink! When I click on it
my browser is launched automatically and the site is connected.
Would anyone tell me how to archive that effect in my own application?</PRE>


<I>[Robert E. Baker, bobbaker@cris.com]</I><P>

Create your label component with the URL (I call mine URLLabel) as it's
caption.  I also make the text a different color to make it stand out from
any other labels on the form.  Then, on the OnClick even for the label,
enter the following code:<p>

<HR><PRE>
procedure TTOKAboutBox.URLLabelClick(Sender: TObject);
var TempString : array[0..79] of char;
begin
   StrPCopy(TempString,URLLabel.Caption);
   OpenObject(TempString);
end;
</PRE><HR>

And also place the following procedure where the OnClick event can see it:

<HR><PRE>
procedure TTOKAboutBox.OpenObject(sObjectPath : PChar);
begin
 ShellExecute(0, Nil, sObjectPath, Nil, Nil, SW_NORMAL);
end;
</PRE><HR>

Put ShellAPI in your uses clause<p>

As far as the cursor goes, I set the URLLabel.Cursor property to crAppStart.

<HR SIZE="6" color="#00FF00">
<P><A HREF="mailto:rdb@ktibv.nl">
<FONT SIZE=2>Please email me</FONT></A><FONT SIZE=2> and tell me if you liked this page.<BR>
<SCRIPT LANGUAGE="JavaScript"><!--
	document.write("Last modified " + document.lastModified);
// --></SCRIPT></FONT>
<P ALIGN="CENTER"><CENTER><TABLE CELLSPACING=0 BORDER=0>
<TR><TD VALIGN="MIDDLE">
<P><FONT SIZE=2>This page has been created with </FONT></TD>
<TD VALIGN="MIDDLE">
<P><A HREF="http://www.dexnet.com./homesite.html"><IMG SRC="../images/hs25ani.gif" WIDTH=88 HEIGHT=31 BORDER=0 ALT="HomeSite 2.5b"></A></TD>
</TR>
</TABLE>
</CENTER></P>

<P>&nbsp;</P>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -