Page 1 of 1

how to check if the TRichViewEdit document content is empty?

Posted: Mon Sep 14, 2009 4:50 pm
by rescuer
Dear sirs,
how to check TRichViewEdit document's content is empty?
as is, when I call TRichViewEdit's Clear() method, I must check if user typed, or no. so I want to know how to check this condition.

thanks in advance.

Posted: Mon Sep 14, 2009 8:33 pm
by proxy3d

Code: Select all

function  IsEmpty(rve: TCustomRichViewEdit): Boolean; 
begin 
  Result := (rve.ItemCount=0) or ((rve.ItemCount=1) and (rve.GetItemStyle(0)>=0) and (rve.GetItemText(0)='')); 
end; 

I tested, that's ok, thank you very much, proxy3d!!

Posted: Tue Sep 15, 2009 6:48 am
by rescuer
I tested, that's ok, thank you very much, proxy3d!!