custom combobox - how to make 1st item selected

323
1
05-18-2011 01:07 PM
by Anonymous User
Not applicable
Original User: helenchu

hi,
I follow the this sample codes, but don't know how to make the 1st item shown at start up.  Thank you for your help.

    Public Sub New()
    Dim serviceLinks As String() = {"Add a World Map Service", "World_Topo_Map", "World_Terrain_Base"}
    For Each currLink As String In serviceLinks
        Add(currLink)
    Next
End Sub

Protected Overloads Overrides Sub OnSelChange(ByVal cookie As Integer)
Dim selectedURL As String = Nothing
' The value property provides the selected item.
Select Case Value
    Case "World_Topo_Map"
        If True Then
            selectedURL = "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=lyr&v=9.2"
            Exit Select
        End If
    Case "World_Terrain_Base"
        If True Then
            selectedURL = "http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer?f=lyr&v=9.2"
            Exit Select
        End If
End Select
If selectedURL IsNot Nothing Then
    System.Diagnostics.Process.Start(selectedURL)
End If
MyBase.OnSelChange(cookie)
End Sub
0 Kudos
1 Reply
helenchu
Occasional Contributor II
Never mind.  I figured it out.  Thanks.
0 Kudos