Spread Windows Forms 7.0 Product Documentation
Focus Method
See Also  Support Options
FarPoint.Win Assembly > FarPoint.Win Namespace > ElementWindowless Class : Focus Method


giveFocus
Whether the element is to receive focus

Glossary Item Box

Moves the focus to the element.

Syntax

Visual Basic (Declaration) 
Public Overridable Sub Focus( _
   ByVal giveFocus As Boolean _
) 
Visual Basic (Usage)Copy Code
Dim instance As ElementWindowless
Dim giveFocus As Boolean
 
instance.Focus(giveFocus)
C# 
public virtual void Focus( 
   bool giveFocus
)

Parameters

giveFocus
Whether the element is to receive focus

Remarks

Use this method to move the focus to or remove the focus from the element.

If you try to move the focus to the element by using this method, but the CanFocus property or the Enabled property is set to false, the focus will not move to the element.

You can check whether the element already has the focus using the Focused property.

For some elements, when the element receives the focus, if it can, the element can display a focus rectangle. Specify whether and how the focus rectangle appears by setting the DrawFocusRectangle property.

Some controls display a cursor when they receive the focus. Specify the position of the cursor by setting the EditModeCursorPosition property, if supported.

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.