本来你要写这样两句 Image.Canvas.Brush.Color:=ClBlack; Image.Canvas.Burxh.style:=bsSolid; 你可写成这样 with Image.Canvas.Brush do begin Color:=ClBlack; style:=bsSolid; end; 明白了吗。 try X := Y/Z; except on EZeroDivide do HandleZeroDivide; end; 如果Try块中有异常,则在except中抛出异常。 明白了吗。
Image.Canvas.Brush.Color:=ClBlack;
Image.Canvas.Burxh.style:=bsSolid;
你可写成这样
with Image.Canvas.Brush do
begin
Color:=ClBlack;
style:=bsSolid;
end;
明白了吗。
try
X := Y/Z;
except
on EZeroDivide do HandleZeroDivide;
end;
如果Try块中有异常,则在except中抛出异常。
明白了吗。