Share via


Container property

Returns the object that contains the specified embedded map. If the container does not support automation, or if the map is not embedded, this property returns "Nothing". Read-only.

Applies to

Objects:  Map

Syntax

object.Container

Parameters

Part Description
object Required. An expression that returns a Map object.

Example

    Option Explicit

  Public myApp As MapPoint.Application   Public myMap As MapPoint.Map
  Private Sub Command1_Click()
  If (TypeName(myMap.Container) = "Nothing") Then     MsgBox "MapPoint is not embedded in a container."     Else     MsgBox "We're embedded in " & myMap.Container.Name     End If
  End Sub
  Private Sub Form_Load()
  Set myApp = CreateObject("MapPoint.Application.NA")   Set myMap = myApp.ActiveMap
  End Sub

To check if the Map is running in the Control

    If TypeName(objMap.Container) = "MappointControl" Then
    MsgBox "This is in the Control"
    objControl = objMap.Container
  End If