Export (0) Print
Expand All

ActiveDesignerEventArgs Class

Provides data for the ActiveDesigner event.

For a list of all members of this type, see ActiveDesignerEventArgs Members.

System.Object
   System.EventArgs
      System.ComponentModel.Design.ActiveDesignerEventArgs

[Visual Basic]
Public Class ActiveDesignerEventArgs
   Inherits EventArgs
[C#]
public class ActiveDesignerEventArgs : EventArgs
[C++]
public __gc class ActiveDesignerEventArgs : public EventArgs
[JScript]
public class ActiveDesignerEventArgs extends EventArgs

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

The ActiveDesigner event occurs when the currently active document changes. The active document changes when a new document is created, an existing document is opened, or a document is closed.

When you create an ActiveDesignerEventArgs delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see Events and Delegates.

Example

[Visual Basic, C#, C++] The following example method returns an ActiveDesignerEventArgs that contains a specified reference to the IDesignerHost for the designer losing focus and a specified reference to the IDesignerHost for the designer gaining focus.

[Visual Basic] 
Public Function CreateActiveDesignerEventArgs(ByVal losingFocus As IDesignerHost, ByVal gainingFocus As IDesignerHost) As ActiveDesignerEventArgs
    Dim e As New ActiveDesignerEventArgs(losingFocus, gainingFocus)
    Return e
End Function

[C#] 
public ActiveDesignerEventArgs CreateActiveDesignerEventArgs(IDesignerHost losingFocus, IDesignerHost gainingFocus)
{
    ActiveDesignerEventArgs e = new ActiveDesignerEventArgs(losingFocus, gainingFocus);
    return e;
}

[C++] 
ActiveDesignerEventArgs* CreateActiveDesignerEventArgs(IDesignerHost* losingFocus, IDesignerHost* gainingFocus) {
    ActiveDesignerEventArgs* e = new ActiveDesignerEventArgs(losingFocus, gainingFocus);
    return e;
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.ComponentModel.Design

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System (in System.dll)

See Also

ActiveDesignerEventArgs Members | System.ComponentModel.Design Namespace | ActiveDesignerEventHandler | ActiveDesigner

Show:
© 2014 Microsoft