This documentation is archived and is not being maintained.

GeoCoordinateWatcher.StatusChanged Event

Indicates that the status of the GeoCoordinateWatcher object has changed.

Namespace:  System.Device.Location
Assembly:  System.Device (in System.Device.dll)

Public Event StatusChanged As EventHandler(Of GeoPositionStatusChangedEventArgs)

The StatusChanged event is raised on the same thread that the GeoCoordinateWatcher object was created on.

The following example demonstrates how to handle StatusChanged events.

Imports System.Device.Location
Module GetLocationEvent

    Sub ShowStatusUpdates()
        Dim Watcher As GeoCoordinateWatcher
        Watcher = New GeoCoordinateWatcher()
        AddHandler Watcher.StatusChanged, AddressOf watcher_StatusChanged

        Console.WriteLine("Enter any key to quit.")
    End Sub

    Sub watcher_StatusChanged(ByVal sender As Object, ByVal e As GeoPositionStatusChangedEventArgs)
        Select Case e.Status
            Case GeoPositionStatus.Initializing
                Console.WriteLine("Working on location fix")
            Case GeoPositionStatus.Ready
                Console.WriteLine("Have location")
            Case GeoPositionStatus.NoData
                Console.WriteLine("No data")
            Case GeoPositionStatus.Disabled
        End Select
    End Sub

    Public Sub Main()
    End Sub
End Module

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.