Spread Windows Forms 10.0 Product Documentation
Enabled Property (ElementWindowless)
Example 


Gets or sets whether the object can receive focus and respond to user actions.
Syntax
'Declaration
 
Public Overridable Property Enabled As Boolean
'Usage
 
Dim instance As ElementWindowless
Dim value As Boolean
 
instance.Enabled = value
 
value = instance.Enabled
public virtual bool Enabled {get; set;}

Property Value

Boolean value: true if element is enabled; false otherwise
Remarks

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

If this property is true, you can still specify that the element cannot receive focus by setting the CanFocus property to false.

If the CanFocus property is set to true, you can check whether the element has the focus, or move the focus to the element, by calling the Focus method. You can specify whether and how the focus rectangle is drawn for the element by setting the DrawFocusRectangle property.

Contrast this property with the Selectable property and the CanFocus property. Use the Selectable property to specify whether users can interact with the element. Use the CanFocus property to specify whether an element can receive the focus.

Example
private void button1_Click(object sender, System.EventArgs e)
{
element.Visible = true;
element.Enabled = false;
element.Selectable = 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
End Sub
Requirements

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

See Also

Reference

ElementWindowless Class
ElementWindowless Members
Focus Method
CanFocus Property
Focused Property
DrawFocusRectangle Property
Selectable Property

 

 


Copyright © GrapeCity, inc. All rights reserved.