Search
Control.focus Event
See Also
Collapse All Expand All Language Filter: All Language Filter: Multiple Language Filter: None Language Filter: C# Language Filter: Visual Basic Language Filter: Java Language Filter: JavaScript Language Filter: C++ Language Filter: XAML
C#
Visual Basic
Java
JavaScript
C++
XAML
Introduction
General Information
What's New In This Release
Version History
Getting Started
Code Completion With VSDoc IntelliSense
Programming Interface Overview
Tutorials
Reference
MindFusion.Common
Control Class
Control Members
Control Constructor
Control Methods
Control Properties
Control Events
controlLoad Event
controlUnload Event
focus Event
DateFormats Class
DateSettings Class
EventDispatcher Class
IdGenerator Class
Locale Class
NotifyCollectionChangedAction Class
NotifyCollectionChangedEventArgs Class
NotifyCollectionChangingEventArgs Class
PropertyEventArgs Class
UIControl Class
Unit Class
UnitType Enumeration
MindFusion.Common.Collections
MindFusion.Controls
MindFusion.Scheduling
Licensing
Online Resources
Technical Support
MindFusion Products

Raised when the control is focused.

Namespace: MindFusion.Common
Assembly: Control.js

## Syntax

JavaScript Copy Code
EventDispatcher focus

## Event Data

The event handler method receives the following arguments:
sender
A Control instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
An EventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.

## Example

The following code handles the focus event for a Window instance.

JavaScript Copy Code
// Handle the focus event. window1.focus.addEventListener(handleFocusEvent); // This is the handler function of the wndow1 focus event. // The sender argument is a reference to the Window. function handleFocusEvent(sender) { if(sender.id == "window1") { //do something } }

## See Also

Control Members
Control Class
MindFusion.Common Namespace