[code=delphi]
var
OldColor:tcolor;
procedure TForm1.Label2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if setcap= false then
begin
oldcolor:=label2.font.Color;
label2.Font.Color:=clActiveCaption;
SetCapturecontrol(label2);
setcap:=true;
end
else
begin
label2.Font.Color:=oldcolor;
SetCapturecontrol(nil);
setcap:=false;
end;
end;
[/code]
转载请注明:鸟儿博客 » delphi设置label鼠标移动变色