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;

 

 posted on 2015-06-27 16:31  宝兰  阅读(122)  评论(0编辑  收藏  举报