一个简单的问题,找了半小时没找到,DFW们进来拿分 (30分)

I

Imfish

Unregistered / Unconfirmed
GUEST, unregistred user!
看到有的程序在“关于”中放了一个e-mail点击即可打开outlook来写邮件,怎样做的,望指点
用procedure TSetform.Pnl4Click(Sender: TObject);
begin
ShellExecute(Handle,'open','mailto:huangyi03590358@sina.com',nil, nil, SW_showNORMAL);
end;
不能实现和网页中一样的效果,是不是还得另外对label处理,有下划线,这样的效果怎样实现
 
好像是用shellexecute吧
 
uses winprocs;
.
.
begin
win.exec(..);//调用外部exe文件
end;
 
再找 以前说过很多次了 :)
 
Uses ShellApi;
...........
shellexecute(handle,nil,'mailto:jollier@371.net',nil,nil,SW_SHOWNORMAL);
这还得看你的系统中的默认发邮件软件是不是OUTLOOK.
 
ShellExecute(Handle, 'open','mailto:youname@yourweb.com,nil, nil, SW_NORMAL);
 
ShellExecute(Handle, 'open','mailto:youname@yourweb.com,nil, nil, SW_NORMAL);

 
还有什么问题吗?
label1.Font.Style := [fsUnderline]
 
还要单独对label写代码。
但你要先写一个关于检测鼠标进入和离开label的过程。
 
procedure TzypNeoForm.Label1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
Label1.Font.Color:= clRed;
end;

procedure TzypNeoForm.Label1MouseLeave(Sender: TObject);
begin
Label1.Font.Color:= clBlue;
end;
 
lable1的事件中没有mouseleave事件呀
你的怎样做的
 
TO:Imfish
有的,看清楚再说。
 
to 影子;
我是一个穷人,还在用delphi5呢,5中是不是没有这个事件
 
怎麼會沒有ONmouseleave事件???
你是用哪個版本的DELPHI?
 

上次给别人写的一个组件,是speedbutton的。你改一下吧,不过不知道在d5中有没有效果。

//添加鼠标移入移出事件及图片切换
unit SpeedButtonEx;

interface

uses
Windows, Messages, SysUtils, Classes, Controls, Buttons, Graphics;

type
TSpeedButtonEx = class(TSpeedButton)
private
FEnterGlyph: TBitmap;
FLeaveGlyph: TBitmap;
FOnMouseLeave: TNotifyEvent;
FOnMouseEnter: TNotifyEvent;

procedure SetEnterGlyph(Value: TBitmap);
procedure SetLeaveGlyph(Value: TBitmap);

procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
protected
{ Protected declarations }
public
constructor Create(AOwner: TComponent); override;
destructor Destroy;override;
published
property EnterGlyph: TBitmap read FEnterGlyph write SetEnterGlyph; //ÒÆÈëͼƬ
property LeaveGlyph: TBitmap read FLeaveGlyph write SetLeaveGlyph; //ÒƳöͼƬ
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter; //ÒÆÈëʼþ
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave; //ÒƳöʼþ

end;

procedure Register;

implementation

constructor TSpeedButtonEx.Create(AOwner: TComponent);
begin
inherited;
FEnterGlyph := TBitmap.Create;
FLeaveGlyph := TBitmap.Create;
end;

destructor TSpeedButtonEx.Destroy;
begin
FEnterGlyph.Free;
FLeaveGlyph.Free;
inherited;
end;

procedure TSpeedButtonEx.SetEnterGlyph(Value: TBitmap);
begin
FEnterGlyph.Assign(Value);
end;

procedure TSpeedButtonEx.SetLeaveGlyph(Value: TBitmap);
begin
FLeaveGlyph.Assign(Value);
end;

procedure TSpeedButtonEx.CMMouseEnter(var Message: TMessage); //message CM_MOUSEENTER;
begin
if not FEnterGlyph.Empty then
Glyph.Assign(FEnterGlyph);
inherited;
if Assigned(FOnMouseEnter) then
FOnMouseEnter(Self);
end;

procedure TSpeedButtonEx.CMMouseLeave(var Message: TMessage); //message CM_MOUSELEAVE;
begin
if not FLeaveGlyph.Empty then
Glyph.Assign(FLeaveGlyph);
inherited;
if Assigned(FOnMouseLeave) then
FOnMouseLeave(Self);
end;

procedure Register;
begin
RegisterComponents('dwh', [TSpeedButtonEx]);
end;

end.
 
这个问题解决了,给各位加分
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
897
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部