語言

ToolStripComboBox.FindStringExact 方法

定義

找到完全符合指定字串的項目。

多載

名稱 Description
FindStringExact(String, Int32)

尋找指定索引後第一個與該字串完全吻合的項目。

FindStringExact(String)

找到第一個與指定字串完全相符的項目 ToolStripComboBox 。

FindStringExact(String, Int32)

來源:
ToolStripComboBox.cs
來源:
ToolStripComboBox.cs
來源:
ToolStripComboBox.cs
來源:
ToolStripComboBox.cs
來源:
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 是一個子串,用來與組合框列表中項目相關的文字進行比較。 搜尋會從文字開頭的指定索引開始進行部分匹配,並回傳列表中第一個符合指定子字串的項目。 接著你可以執行任務,例如移除包含搜尋文字的項目或更改項目文字。 找到指定文字後,若想在 中搜尋其他完全相同的文字ToolStripComboBox實例,請使用此方法指定 。ToolStripComboBox 如果你想搜尋部分吻合詞彙而非精確詞彙,請使用該 FindString 方法。

適用於

FindStringExact(String)

來源:
ToolStripComboBox.cs
來源:
ToolStripComboBox.cs
來源:
ToolStripComboBox.cs
來源:
ToolStripComboBox.cs
來源:
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 方法。

適用於