Returns bounds of selected part of document.procedure GetSelectionBounds(out StartItemNo, StartItemOffs, EndItemNo, EndItemOffs: Integer; Normalize: Boolean);ParametersStartItemNo –index of the first selected item.StartItemOffs:§if the first item is a [url=mkMSITStore:x:\TRichViewTrialDelphi_2\TRichView\Help\RichView.chm::/idio_text_items.html]text item[/url], then the selection start is before the StartItemOffs-th character of string (characters in strings are counted from 1, the last position (after the text item) is text length+1). The exception is empty text items formatted with style having [url=mkMSITStore:x:\TRichViewTrialDelphi_2\TRichView\Help\RichView.chm::/idh_tcustomrvfontinfo_emptywidth.html]EmptyWidth[/url]>0; for them, the position after the item is 2.§if the first item is not a text, then §if StartItemOffs=0, then the selection start is before the first item;§if StartItemOffs=1, then the selection start is after the first item.EndItemNo – index of the last selected item.EndItemOffs:§if the last item is a text item, then the selection end is before the EndItemOffs-th character of string (characters in strings are counted from 1, the last position (after the text item) is text length+1). The exception is empty text items formatted with style having [url=mkMSITStore:x:\TRichViewTrialDelphi_2\TRichView\Help\RichView.chm::/idh_tcustomrvfontinfo_emptywidth.html]EmptyWidth[/url]>0; for them, the position after the item is 2.§if the last item is not a text, then §if EndItemOffs=0, then the selection end is before the last item§if EndItemOffs=1, then the selection end is after the last item.Normalize:§if True, the upper bound of the selection is returned in StartItemNo:StartItemOffs, and the lower bound is in EndItemNo:EndItemOffs;§if False, bounds are returned as they were selected by user. The selection is empty if§StartItemNo=-1 or§StartItemNo=EndItemNo and StartItemOffs=EndItemOffs. This method must be called only when the document is [url=]formatted[/url]. If you want to get selection bounds using richedit-like parameters (SelStart and SelLength), use [url=mkMSITStore:x:\TRichViewTrialDelphi_2\TRichView\Help\RichView.chm::/idh_rvlinear.html]RVGetSelection from RVLinear[/url] unit instead.See also methods:§[url=mkMSITStore:x:\TRichViewTrialDelphi_2\TRichView\Help\RichView.chm::/idh_trichview_setselectionbounds.html]SetSelectionBounds[/url].See also:§[url=mkMSITStore:x:\TRichViewTrialDelphi_2\TRichView\Help\RichView.chm::/selecting_part_of_richview_document.html]Working with selection.[/url]
返回文档的部分边界 procedure GetSelectionBounds(out StartItemNo, StartItemOffs, EndItemNo, EndItemOffs: Integer; Normalize: Boolean);
RichViewEdit1.GetSelectionBounds(2, 2 ,2 ,2, True); //我这么写没错吧?第1个参数,选定项的索引假设为2第2个参数,起始项目的偏移量也假设为2第3个参数,结束的索引也为2第4个参数,结束的偏移量也为2第5个参数布尔型,为True第1个参数它就报错啊。
我给它改成 形参,它就不报下面的错误了。E2033 Types of actual and formal var parameters must be identical (Delphi)