使用新文本替换在展开选定内容中的文本范围。
命名空间: Microsoft.VisualStudio.TextManager.Interop
程序集: Microsoft.VisualStudio.TextManager.Interop.8.0(在 Microsoft.VisualStudio.TextManager.Interop.8.0.dll 中)
语法
声明
Function SetText ( _
bstrText As String, _
fReplaceAll As Integer _
) As Integer
int SetText(
string bstrText,
int fReplaceAll
)
int SetText(
[InAttribute] String^ bstrText,
[InAttribute] int fReplaceAll
)
abstract SetText :
bstrText:string *
fReplaceAll:int -> int
function SetText(
bstrText : String,
fReplaceAll : int
) : int
参数
bstrText
类型:String[in] 包含新文本的字符串。
fReplaceAll
类型:Int32[in] 如果 fReplaceAll 为 true, SetText 替换缓冲区中的所有文本 (包括标题文本)。 否则,因此,如果有一个零长度选择, SetText 在选择位置替换任何在选框内或插入。
返回值
类型:Int32
如果方法成功,则返回 VSConstants.S_OK。如果失败,它会返回一个错误代码。
备注
C++
从 singlefileeditor.idl:
HRESULT IVsExpansionIntellisenseHost::SetText([in] BSTR bstrText, [in] BOOL fReplaceAll);
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。