Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

FocusManager.SetIsFocusScope(DependencyObject, Boolean) Method

Definition

Namespace:
System.Windows.Input
Assembly:
PresentationCore.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Sets the specified DependencyObject as a focus scope.

public:
 static void SetIsFocusScope(System::Windows::DependencyObject ^ element, bool value);
public static void SetIsFocusScope(System.Windows.DependencyObject element, bool value);
static member SetIsFocusScope : System.Windows.DependencyObject * bool -> unit
Public Shared Sub SetIsFocusScope (element As DependencyObject, value As Boolean)

Parameters

element
DependencyObject

The element to make a focus scope.

value
Boolean

true if element is a focus scope; otherwise, false.

Examples

The follow example makes an element a focus scope by using SetIsFocusScope.

StackPanel focuseScope2 = new StackPanel();
FocusManager.SetIsFocusScope(focuseScope2, true);
Dim focuseScope2 As New StackPanel()
FocusManager.SetIsFocusScope(focuseScope2, True)

Remarks

A focus scope is a container element that keeps track of the FocusManager.FocusedElement within its scope. By default, the Window class is a focus scope as are the Menu, ContextMenu, and ToolBar classes. An element that is a focus scope has IsFocusScope set to true.

For more information on focus, keyboard focus, and logical focus, see the Input Overview.

Applies to


Feedback

Was this page helpful?