Gallery Walkthrough
Gallery.vb
' Copyright 2011 ESRI
' 
' All rights reserved under the copyright laws of the United States
' and applicable international laws, treaties, and conventions.
' 
' You may freely redistribute and use this sample code, with or
' without modification, provided you include the original copyright
' notice and use restrictions.
' 
' See the use restrictions.
' 

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text

Imports ESRI.ArcGISExplorer
Imports ESRI.ArcGISExplorer.Application
Imports ESRI.ArcGISExplorer.Mapping
Imports ESRI.ArcGISExplorer.Data
Imports ESRI.ArcGISExplorer.Threading

Public Class Gallery
    Inherits ESRI.ArcGISExplorer.Application.Gallery

    'Use the ArcGIS_E3SDK environment variable here. It points to the install 
    'location of the ArcGIS Explorer developer kit, i.e. C:\Program Files\Explorer\DeveloperKit.
    Dim _strImage As String = Environment.GetEnvironmentVariable("ArcGIS_E3SDK") + "\\..\\Styles\\SymbolImages\\Points of Interest\\Information.png"

    Public Sub New()

        Dim btnImage As Image = Image.FromFile(_strImage)
        Dim myGalleryItem As GalleryItem = New GalleryItem("MyGalleryItem", btnImage, "Click on the map to add graphic")
        Me.Items.Add(myGalleryItem)

    End Sub


    Public Overrides Sub OnClick(ByVal item As GalleryItem)

        Dim md As MapDisplay = Application.ActiveMapDisplay
        'Track the point on the map of the mouse click
        Dim trackPoint As ESRI.ArcGISExplorer.Geometry.Point = md.TrackPoint()
        'Turn the Point in to a Graphic
        Dim pointGraphic As Graphic = New Graphic(trackPoint)
        'Set the Graphic's symbol to the same as the Gallery Image (Access the Symbol through Marker)
        pointGraphic.Symbol = Symbol.Marker.PointsOfInterest.Information
        'Add the graphic to the map
        md.Graphics.Add(pointGraphic)

    End Sub


End Class