ToolStripComboBox.FindStringExact 方法

定义

查找与指定字符串完全匹配的项。

重载

名称 说明
FindStringExact(String, Int32)

查找与指定字符串完全匹配的指定索引之后的第一项。

FindStringExact(String)

查找与指定字符串完全匹配的第一项 ToolStripComboBox

FindStringExact(String, Int32)

Source:
ToolStripComboBox.cs
Source:
ToolStripComboBox.cs
Source:
ToolStripComboBox.cs
Source:
ToolStripComboBox.cs
Source:
ToolStripComboBox.cs

查找与指定字符串完全匹配的指定索引之后的第一项。

public:
 int FindStringExact(System::String ^ s, int startIndex);
public int FindStringExact(string s, int startIndex);
public int FindStringExact(string? s, int startIndex);
member this.FindStringExact : string * int -> int
Public Function FindStringExact (s As String, startIndex As Integer) As Integer

参数

s
String

String 搜索的。

startIndex
Int32

要搜索的第一项之前项的从零开始的索引。 设置为 -1 从控件的开头进行搜索。

返回

找到的第一项的从零开始的索引;如果未找到匹配项,则返回 -1。

注解

此方法执行的搜索不区分大小写。 该 s 参数是一个子字符串,用于与组合框列表中的项关联的文本进行比较。 搜索从指定索引处的文本开头开始执行部分匹配,并返回列表中与指定子字符串匹配的第一项。 然后,可以执行任务,例如删除包含搜索文本的项或更改项的文本。 找到指定的文本后,如果要搜索其中的确切文本的其他实例,请使用此方法在 <a0/> 中指定起始索引。 如果要搜索部分匹配项而不是确切的单词,请使用 FindString 该方法。

适用于

FindStringExact(String)

Source:
ToolStripComboBox.cs
Source:
ToolStripComboBox.cs
Source:
ToolStripComboBox.cs
Source:
ToolStripComboBox.cs
Source:
ToolStripComboBox.cs

查找与指定字符串完全匹配的第一项 ToolStripComboBox

public:
 int FindStringExact(System::String ^ s);
public int FindStringExact(string s);
public int FindStringExact(string? s);
member this.FindStringExact : string -> int
Public Function FindStringExact (s As String) As Integer

参数

s
String

String 搜索的。

返回

找到的第一项的从零开始的索引;如果未找到匹配项,-1。

注解

此方法执行的搜索不区分大小写。 该 s 参数是一个子字符串,用于与组合框列表中的项关联的文本进行比较。 搜索从指定索引处的文本开头开始执行部分匹配,并返回列表中与指定子字符串匹配的第一项。 然后,可以执行任务,例如删除包含搜索文本的项或更改项的文本。 找到指定的文本后,如果要搜索其中 ToolStripComboBox的其他文本实例,请使用 FindString 方法指定其中的 ToolStripComboBox起始索引。 如果要搜索部分匹配项而不是确切的单词,请使用 FindString 该方法。

适用于