Spread Windows Forms 11.0 Product Documentation
CanFocus Property (ElementWindowless)
Example 


FarPoint.Win Assembly > FarPoint.Win Namespace > ElementWindowless Class : CanFocus Property
Gets or sets whether the element can receive focus.
Syntax
'Declaration
 
Public Overridable Property CanFocus As Boolean
'Usage
 
Dim instance As ElementWindowless
Dim value As Boolean
 
instance.CanFocus = value
 
value = instance.CanFocus
public virtual bool CanFocus {get; set;}

Property Value

Boolean value: true if element can receive focus; false otherwise
Remarks

Use this property to specify whether an element can receive the focus.

If this property is true, you can check whether the element has the focus, or move the focus to the element, by calling the Focus method or check whether the element has the focus using the Focused property.

Specify whether and how the focus rectangle appears in the element by setting the DrawFocusRectangle property. Specify the position of the cursor when the element receives the focus by setting the EditModeCursorPosition property, if appropriate.

If you do not want the element to receive focus nor for the user to interact with it, set the Enabled property to false.

This property is available at run time only.

Contrast this property with the Selectable property and the Enabled property. Use the Selectable property to specify whether users can interact with the element. Use the Enabled property to specify whether the element looks grayed and users can interact with it.

Example
private void button1_Click(object sender, System.EventArgs e)
{
element.Visible = true;
element.Enabled = false;
element.Selectable = false;
element.CanFocus = false;
}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
element.Visible = True
element.Enabled = False
element.Selectable = False
element.CanFocus = False
End Sub
See Also

Reference

ElementWindowless Class
ElementWindowless Members
Focus Method
Focused Property
DrawFocusRectangle Property
EditModeCursorPosition Property
Enabled Property
Selectable Property