请问我如何在一个窗体中不用按钮而用一个超级连接的样式来打开一个对话框
解决方案 »
- dbgrid我怎么判断是否被修改过?
- 读取combobox中部分数据
- 100分,GPRS编程
- 请教如何把DBgrid里的查询数据直接打出来?
- 怎么用ADO直接操作dbf数据文件?连接字符串怎么写?
- 请问怎样关闭预览窗口?(quickreport)
- 禁止使用Alt+F4键关闭窗口。
- 关于“流”
- 一个很菜的问题,关于sql查询
- 请帮忙修改左轻候的论坛离线浏览程序,ADO数据库格式,下载包括数据库和源程序。
- 求用DELPHI调用网页例子。二点结分。
- 在a表中,有id字段,其值分别为5,7,9,11,23等,如何使id按照任何要求的顺序显示,如:显示顺序为:9,23,7,5,11.且要对id进行distinct和分组.
Windows, Classes, Controls, StdCtrls, SysUtils, Forms,
Graphics, ShellAPI;type
TUrlLabel = class(TLabel) private
{ Private declarations }
Url:string;
procedure ExeUrl;
procedure seturl(value:string);
protected
procedure Click;override;
public
{ Public declarations }
constructor Create(AOwner:TComponent);override;
Published
property UrlString:string read Url write seturl;
end;procedure Register;implementationconst
defaulturl:string='http://lb001.51.net';
procedure TUrlLabel.click;
begin
inherited click;
ExeUrl;
end;
constructor TUrlLabel.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
Url:=defaulturl;
Caption:=Url;
font.style:=[fsUnderline];
font.color:=clBlue;
Cursor:=crHandPoint;
end;
procedure TUrlLabel.ExeUrl;
begin
shellexecute(Application.handle,nil,pchar(Url),nil,nil,SW_SHOWNORMAL);
end;
procedure TUrlLabel.seturl(value:string);
begin
Url:=value;
if csDesigning in ComponentState then
begin
Caption := Value;
//Application.MessageBox('Your changed the urlstring!','',mb_ok);
end;
end;procedure Register;
begin
RegisterComponents('mycontrols',[TUrlLabel]);
end;end.
begin
Showmessage('you click me !');
end;
procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
label1.Font.Style:=[fsbold,fsunderline];
label1.font.color:=clyellow;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
label1.Font.Style:=[fsbold];
label1.font.color:=clmaroon;
end;
//打开连接
use shellapi;procedure TForm1.Label1Click(Sender: TObject);
begin
ShellExecute(handle,'open','Explorer',pChar('http://www.csdn.net'),nil,SW_SHOW);
end;