problem move content with control to other position .
Posted: Sat Nov 27, 2010 2:22 pm
I have a table with some controls(button,image) in it, and those controls have onclick event code. when I cut the table and paste to other position(btw, in same richviewedit) by progam. I hope those controls onclick event work.
but the onclick event lost.
another problem.
I have a image in richviewedit. in the image onclick event, change the image picture. but the richviewedit scroll up so image not in current vision and when scroll back ,the image's picture gone.
but the onclick event lost.
Code: Select all
//src_no is the table ItemNo.
//dst_no is the new position ItemNo that the table moved to
_MainRVE.SetSelectionBounds(src_no, 0, src_no, 1);
stream := TMemoryStream.Create;
_MainRVE.SaveRVFToStream(stream, True);
_MainRVE.DeleteParas(src_no, src_no); //delete the table
_MainRVE.Reformat;
dst_no := FindItemNoByItemName(dstId); //find the destation ItemNo
_MainRVE.SetSelectionBounds(dst_no, 0, dst_no, 0); //move caret
stream.Position := 0;
_MainRVE.InsertRVFFromStreamEd(stream);
stream.Free;
_MainRVE.Reformat;
another problem.
I have a image in richviewedit. in the image onclick event, change the image picture. but the richviewedit scroll up so image not in current vision and when scroll back ,the image's picture gone.
Code: Select all
//image onclick event code
img := TImage(Sender);
if img.Tag = 0 then
begin
img.Picture.Bitmap := nil;
img.Picture.LoadFromFile(_AppResourceDir + 'RadioTrue.png');
img.Tag := 1;
end
else
begin
img.Picture.Bitmap := nil;
img.Picture.LoadFromFile(_AppResourceDir + 'RadioFalse.png');
img.Tag := 0;
end;
_MainRVE.Reformat;