本文整理汇总了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