ArcObjects Library Reference (Controls)  

IMapControl3.Object Property

A property that returns the underlying control. This can be used when the control is inside a wrapper object that has been added by a development environment.

[Visual Basic .NET]
Public ReadOnly Property Object As Object
[C#]
public object Object {get;}
[C++]
HRESULT get_Object(
  IDispatch** ppDispatch
);
[C++]

Parameters

ppDispatch [out, retval]   ppDispatch is a parameter of type IDispatch*

Product Availability

Available with ArcGIS Engine.

Description

In some development environments it is not possible to query interface directly on the control to other COM interfaces, beacuse the control is contained within a wrapper object. To get the real control use the Object property.

[C#]

When querying interface to IMapControl2, IMapControl3, IMapControl4 or IMapControlDefault  in Visual Basic .NET or Visual C# .NET the Object property or container specific code must be used. This is because .NET contains the real control inside a wrapper object known as an host.

IMapControl3 mapControl = axMapControl1.Object as IMapControl3;

[Visual Basic .NET]

When querying interface to IMapControl2, IMapControl3, IMapControl4 or IMapControlDefault  in Visual Basic .NET or Visual C# .NET the Object property or container specific code must be used. This is because .NET contains the real control inside a wrapper object known as an host.

Dim mapControl As IMapControl3 = AxMapControl1.Object

See Also

IMapControl3 Interface

.NET Samples

Implementing a property page for an ArcGIS Engine application (Code Files: frmMain) | Save a layer file in a MapControl application (Code Files: frmMain) | Schematics Engine application (Code Files: MainForm) | Simple dynamic display application (Code Files: MainForm) | Synchronized MapControl and PageLayoutControl application (Code Files: ControlsSynchronizer) | Temporal statistics (Code Files: MainForm) |