本文整理汇总了VB.NET中System.Windows.Controls.UIElementCollection.IndexOf方法的典型用法代码示例。如果您正苦于以下问题:VB.NET UIElementCollection.IndexOf方法的具体用法?VB.NET UIElementCollection.IndexOf怎么用?VB.NET UIElementCollection.IndexOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了UIElementCollection.IndexOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: FindIndex
Dim c_counter as Integer = 0
Private Sub FindIndex(ByVal sender As Object, ByVal args As RoutedEventArgs)
Try
Dim newText As TextBlock = New TextBlock()
c_counter = c_counter + 1
' Add this element to the UIElementCollection of the DockPanel element.
MainDisplayPanel.Children.Add(newText)
' Add a text node under the Text element. This text is displayed.
newText.Text = "New element #" & CStr(c_counter)
DockPanel.SetDock(newText, Dock.Top)
' Display the Index number of the new element.
TxtDisplay.Text = "The Index of the new element is " & MainDisplayPanel.Children.IndexOf(newText)
Catch ex As System.Exception
System.Windows.MessageBox.Show(ex.Message)
End Try
End Sub