作者:VB.NET开发
项目:System.Windows.Automation.Provide
''' <summary>
''' Returns the child element that is selected when the list gets focus.
''' </summary>
''' <returns>The selected item.</returns>
''' <remarks>
''' SelectedIndex is a class property that maintains the index of the currently
''' selected item in the myItems collection.</remarks>
Function GetFocus() As IRawElementProviderFragment _
Implements IRawElementProviderFragmentRoot.GetFocus
If SelectedIndex >= 0 Then
Return DirectCast(myItems(SelectedIndex), IRawElementProviderFragment)
Else
Return Nothing
End If
End Function 'IRawElementProviderFragmentRoot.GetFocus