我的代码为“一致”TPanel
,条件是 mo曲被 h弃。 我也有一套法典,可以加以统一。
procedure Tmain.pStarting1MouseEnter(Sender: TObject);
begin
if sender = pStarting1 then pStarting1.BevelInner := bvLowered;
if sender = pStarting2 then pStarting2.BevelInner := bvLowered;
if sender = pStarting3 then pStarting3.BevelInner := bvLowered;
if sender = pStarting4 then pStarting4.BevelInner := bvLowered;
if sender = pStarting5 then pStarting5.BevelInner := bvLowered;
if sender = pStarting6 then pStarting6.BevelInner := bvLowered;
if sender = pStarting7 then pStarting7.BevelInner := bvLowered;
if sender = pStarting8 then pStarting8.BevelInner := bvLowered;
if sender = pStarting9 then pStarting9.BevelInner := bvLowered;
end;
你可以看到,它非常重复,因为我有另外27条<代码>。 TPanels to animate, that will mean another 27 Line of repetitous Code. 因此,我可以选择这样做吗?
I have also tried placing that block of code into a separate procedure (in the same unit). but Delphi tells me that sender
is undeclared.