TEdit的 Clear 和 赋值 ''

function TControl.GetText: TCaption;
var
  Len: Integer;
begin
  Len := GetTextLen;
  SetString(Result, PChar(nil), Len);
  if Len <> 0 then GetTextBuf(Pointer(Result), Len + 1);
end;

procedure TControl.SetText(const Value: TCaption);
begin
  if GetText <> Value then SetTextBuf(PChar(Value));
end;
procedure TCustomEdit.Clear;
begin
  SetWindowText(Handle, '');
end;
原文地址:https://www.cnblogs.com/CodeGear/p/4604232.html