How to check if RVE contain picture?
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes, it's possible to do it with recursive procedure.
Another way is using (undocumented) RVData.EnumItems method. This method calls the specified procedure for each item in TRichView.
Another way is using (undocumented) RVData.EnumItems method. This method calls the specified procedure for each item in TRichView.
Code: Select all
// This procedure will be called for each RichView item
procedure TForm3.EnumItemsProc(RVData: TCustomRVData; ItemNo: Integer;
var UserData1: Integer; const UserData2: String;
var ContinueEnum: Boolean);
begin
if (RVData.GetItemStyle(ItemNo)=rvsPicture) or
(RVData.GetItemStyle(ItemNo)=rvsHotPicture) then begin
UserData1 := 1;
ContinueEnum := False;
end
else
ContinueEnum := True;
end;
procedure TForm3.Button1Click(Sender: TObject);
var HasPictures: Integer;
begin
HasPictures := 0;
RichViewEdit1.RVData.EnumItems(EnumItemsProc, HasPictures, '');
if HasPictures<>0 then
Caption := 'YES'
else
Caption := 'NO';
end;
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: