我现在觉得也许是事件的类型不对
procedure tform1.mymouseup(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if button=mbleft then
begin
if ssctrl in shift then
begin
acomp[(sender as tdbmemo).tag].width:=acomp[(sender as tdbmemo).tag].Width +x;
acomp[(sender as tdbmemo).tag].height:=acomp[(sender as tdbmemo).tag].height +x;
bcomp[(sender as tlabel).tag].Width :=bcomp[(sender as tlabel).tag].Width +x;
bcomp[(sender as tlabel).tag].Height :=bcomp[(sender as tlabel).tag].Height +y;
if bcomp[(sender as tlabel).tag].width < 8 then
bcomp[(sender as tlabel).tag].width:=8;
if bcomp[(sender as tlabel).tag].Height <8 then
bcomp[(sender as tlabel).tag].height:=8;
if acomp[(sender as tdbmemo).tag].width < 8 then
acomp[(sender as tdbmemo).tag].width:=8;
if acomp[(sender as tdbmemo).tag].Height <8 then
acomp[(sender as tdbmemo).tag].height:=8;
end
else if ssshift in shift then
begin
comlist.add(sender);
end
else if ssalt in shift then
begin
bcomp[(sender as tlabel).tag].left:=bcomp[(sender as tlabel).tag].Left +x;
bcomp[(sender as tlabel).tag].top:=bcomp[(sender as tlabel).tag].Top +y;
acomp[(sender as tdbmemo).tag].left:=acomp[(sender as tdbmemo).tag].Left +x;
acomp[(sender as tdbmemo).tag].top:=acomp[(sender as tdbmemo).tag].Top +y;
end;
end ;
end;
在次声明,我第一次粘的代码是简写,在程序中我给tag付了值