how to check if the TRichViewEdit document content is empty?

General TRichView support forum. Please post your questions here
Post Reply
rescuer
Posts: 4
Joined: Mon Sep 14, 2009 4:21 pm

how to check if the TRichViewEdit document content is empty?

Post 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.
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post 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; 
rescuer
Posts: 4
Joined: Mon Sep 14, 2009 4:21 pm

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

Post by rescuer »

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