パラメータ
- sheetIndex
- 検索を行うシートのインデックス
- searchString
- 検索文字列
- searchRowHeaders
- 列ヘッダの代わりに行ヘッダを検索するかどうか
- foundRowIndex
- 検索文字列が見つかった行のインデックス
- foundColumnIndex
- 検索文字列が見つかった列のインデックス
戻り値の型
文字列が見つかったセルまたはセル項目のタイプを示す
SearchFoundFlags 設定が返されます。
また、foundRowIndex と foundColumnIndex は、文字列が見つかったセルの行インデックスおよび列インデックスを返します。
次のサンプルコードは、行ヘッダのテキストを検索します。
// Form Load
fpSpread1.Sheets[0].RowHeader.Cells[0, 0].Text = "test";
private void button1_Click(object sender, System.EventArgs e)
{
int x = 0;
int y = 0;
FarPoint.Win.Spread.SearchFoundFlags sff;
sff = fpSpread1.SearchHeaders(0, "test", true, ref x, ref y);
listBox1.Items.Add(sff.ToString());
listBox1.Items.Add(x.ToString());
listBox1.Items.Add(y.ToString());
}
' Form Load
FpSpread1.Sheets(0).RowHeader.Cells(0, 0).Text = "test"
Dim x As Integer
Dim y As Integer
Dim sff As FarPoint.Win.Spread.SearchFoundFlags
sff = FpSpread1.SearchHeaders(0, "test", True, x, y)
ListBox1.Items.Add(sff.ToString())
ListBox1.Items.Add(x)
ListBox1.Items.Add(y)