After I insert a label item I want this label item to be the one and only selected item (and highlighted).
Unfortunately no luck.
Any suggestions?
Thanks for your help,
Frank.
This is a part of the source:
li := TRVLabelItemInfo.CreateEx(RichViewEdit1.RVData, TEXTSTYLE_VARIABLE, '['+Variable.Description+']');
If RichViewEdit1.InsertItem('', li)
then begin
ItemNo := RichViewEdit1.CurItemNo;
RichViewEdit1.ReFormat;
RichViewEdit1.SetSelectionBounds(ItemNo, RichViewEdit1.GetOffsAfterItem(ItemNo),
ItemNo, RichViewEdit1.GetOffsAfterItem(ItemNo)+1)
end;
Selecti the Inserted Item
-
- Posts: 6
- Joined: Thu Oct 20, 2005 2:29 pm
- Location: The Netherlands
-
- Site Admin
- Posts: 17522
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Code: Select all
var rve: TCustomRichViewEdit;
li := TRVLabelItemInfo.CreateEx(RichViewEdit1.RVData, TEXTSTYLE_VARIABLE, '['+Variable.Description+']');
If RichViewEdit1.InsertItem('', li) then begin
rve := RichViewEdit1.TopLevelEditor;
ItemNo := rve.CurItemNo;
rve.SetSelectionBounds(ItemNo, rve.GetOffsBeforeItem(ItemNo), ItemNo, rve.GetOffsAfterItem(ItemNo));
rve.Invalidate;
end;
-
- Posts: 6
- Joined: Thu Oct 20, 2005 2:29 pm
- Location: The Netherlands