UIElement.MoveFocus(TraversalRequest) 方法

定义

尝试将焦点从此元素移到其他元素。Attempts to move focus from this element to another element. 移动焦点的方向由指导方向指定,该方向在此元素的可视父级的组织结构中解释。The direction to move focus is specified by a guidance direction, which is interpreted within the organization of the visual parent for this element.

public:
 virtual bool MoveFocus(System::Windows::Input::TraversalRequest ^ request);
public virtual bool MoveFocus (System.Windows.Input.TraversalRequest request);
abstract member MoveFocus : System.Windows.Input.TraversalRequest -> bool
override this.MoveFocus : System.Windows.Input.TraversalRequest -> bool
Public Overridable Function MoveFocus (request As TraversalRequest) As Boolean

参数

request
TraversalRequest

一个遍历请求,其中包含一个属性,该属性指示以现有 Tab 键顺序遍历的模式或视觉移动的方向。A traversal request, which contains a property that indicates either a mode to traverse in existing tab order, or a direction to move visually.

返回

如果执行了请求的遍历,则为 true;否则为 falsetrue if the requested traversal was performed; otherwise, false.

注解

请确保选中此方法的返回值。Make sure you check the return value of this method. 如果遍历运行到由控件的组合定义的制表位,并且遍历请求未请求换行,则可能会返回 false 的返回值。A return value of false might be returned if the traversal runs into a tab stop that is defined by a control's composition, and the traversal request did not request to wrap.

适用于

另请参阅