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;

 

你可能感兴趣的:(clear)