''' <summary>
''' 語句を検索します。
''' </summary>
''' <param name="grid">WinGrid 参照。</param>
''' <param name="s">検索したい文字列。</</param>
Public Shared Sub FindPhrase(ByVal grid As UltraGrid, ByVal s As String)
For Each row As UltraGridRow In grid.Rows
For Each cell As UltraGridCell In row.Cells
If cell.Text.Contains(s) Then
'セルを最初にアクティブ化する必要があります
cell.Activate()
'セルは選択を実行するために編集モードでなければなりません
grid.PerformAction(UltraGridAction.EnterEditMode)
'選択を開始します
cell.SelStart = cell.Text.IndexOf(s)
'この長さでは
cell.SelLength = s.Length
'見栄えのために、これを最初の表示可能な行にします
grid.DisplayLayout.RowScrollRegions(0).FirstRow = row
Exit Sub
End If
Next
Next
End Sub