System.Windows.Forms.ToolStripComboBox.FindStringExact Method

Finds the first item in the System.Windows.Forms.ToolStripComboBox that exactly matches the specified string.

Syntax

public int FindStringExact (string s)

Parameters

s
The string to search for.

Returns

The zero-based index of the first item found; -1 if no match is found.

Remarks

The search performed by this method is not case-sensitive. The s parameter is a substring to compare against the text associated with the items in the combo box list. The search performs a partial match starting from the beginning of the text at the specified index, and returns the first item in the list that matches the specified substring. You can then perform tasks, such as removing the item that contains the search text or changing the item's text. Once you have found the specified text, if you want to search for other instances of the text in the System.Windows.Forms.ToolStripComboBox, use ToolStripComboBox.FindString(string, int) method to specify a starting index within the System.Windows.Forms.ToolStripComboBox. If you want to search for a partial match instead of the exact word, use the ToolStripComboBox.FindString(string) method.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0