其他语言

本类阅读TOP10

·基于Solaris 开发环境的整体构思
·使用AutoMake轻松生成Makefile
·BCB数据库图像保存技术
·GNU中的Makefile
·射频芯片nRF401天线设计的分析
·iframe 的自适应高度
·BCB之Socket通信
·软件企业如何实施CMM
·入门系列--OpenGL最简单的入门
·WIN95中日志钩子(JournalRecord Hook)的使用

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
如何在 BCB 中制作模仿超级链接效果

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

  用过Winamp的朋友知道Winamp的界面中有一些模仿的超级链接,可以把你直接带到它的相关网站中去。下面这个例子就实现了这种功能,当鼠标点击其中的仿超级链接时,你就会直接到达《电脑商情报》的网址:
  新建一个应用,在窗体Form1上添加一个名为Label1的TLabel组件,然后在代码编辑器中添加以下代码:

void __fastcall TForm1::FormCreate(TObject *Sender)
{
    Label1→Cursor=crHandPoint;
    Label1→Font→Color=clBlue;
    Label1→Font→Style=Label1→Font→Style< Label1→Caption=“http://www.cbinews.com”;
}

void __fastcall TForm1::Label1Click(TObject *Sender)
{
    ShellExecute(Handle,NULL,Label1→Caption.c_str(),NULL,NULL,SW_SHOWNORMAL);
}

void __fastcall TForm1::Label1MouseMove(TObject *Sender, TShiftState Shift, int X, int Y)
{
    Label1→Font→Color=clRed;
}

void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, int X, int Y)
{
    Label1→Font→Color=clBlue;
}

  注意:本示例应该包含头文件。

-=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=-
             /\
  __________/LB\___   OUTINN
 /  _[]_   /____\  \
/_________/| () |\__\ http://outinn.yeah.net/
 |  ____ /-| __ |-\|  Welcome to visit OUTINN!
 |__|==|___| || |__|
 -=--=--=- |_||_| =-  Fancy, [email protected]


相关文章

相关软件