本文整理匯總了VB.NET中System.Windows.Forms.ListView.FindItemWithText方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET ListView.FindItemWithText方法的具體用法?VB.NET ListView.FindItemWithText怎麽用?VB.NET ListView.FindItemWithText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Forms.ListView
的用法示例。
在下文中一共展示了ListView.FindItemWithText方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: InitializeFindListView
' Declare the ListView and Button for the example.
Private findListView As New ListView()
Private WithEvents findButton As New Button()
Private Sub InitializeFindListView()
' Set up the location and event handling for the button.
findButton.Location = New Point(10, 10)
' Set up the location of the ListView and add some items.
findListView.Location = New Point(10, 30)
findListView.Items.Add(New ListViewItem("angle bracket"))
findListView.Items.Add(New ListViewItem("bracket holder"))
findListView.Items.Add(New ListViewItem("bracket"))
' Add the button and ListView to the form.
Me.Controls.Add(findButton)
Me.Controls.Add(findListView)
End Sub
Private Sub findButton_Click(ByVal sender As Object, ByVal e As EventArgs) _
Handles findButton.Click
' Call FindItemWithText, sending output to MessageBox.
Dim item1 As ListViewItem = findListView.FindItemWithText("brack")
If (item1 IsNot Nothing) Then
MessageBox.Show("Calling FindItemWithText passing 'brack': " _
& item1.ToString())
Else
MessageBox.Show("Calling FindItemWithText passing 'brack': null")
End If
End Sub