Trim() -- 去掉字符串中的空格;<br>inherited --用于扩展继承类中的方法;<br>例如:<br>TButton = class(TButtonControl)<br> private<br> ...<br> protected<br> ...<br> public<br> constructor Create(AOwner: TComponent); override;<br> procedure Click; override;<br> ...<br> published<br> ...<br> end;<br><br>implementation<br><br>constructor TButton.Create(AOwner: TComponent);<br>begin<br> inherited Create(AOwner); //调用父对象“TButtonControl”中的Create()方法<br> {以下为此类中增加的功能}<br> ControlStyle := [csSetCaption, csOpaque, csDoubleClicks];<br> Width := 75;<br> Height := 25;<br> TabStop := True;<br>end;<br><br>procedure TButton.Click;<br>var<br> Form: TCustomForm;<br>begin<br> Form := GetParentForm(Self);<br> if Form <> nil then Form.ModalResult := ModalResult;<br> {以上为此类中增加的功能}<br> inherited Click;//调用父对象“TControl”中的"Click"方法<br>end;<br><br>注意:继承关系:TControl-TWinControl-TButtonControl-TButton,<br>“TButton”之前的都为其父对象。<br>用“inherited”关键字的方法声明时后面必有“override”关键字。如:<br>constructor Create(AOwner: TComponent); override;<br>procedure Click; override;