This is the last section in this chapter. We learn how to filter the map to display only desired venues. We will apply this filter on the category selection, for instance, when I select Cafe's, only cafes will be displayed on the map, and so on. Follow these steps to do so:
If necessary, open Visual Studio Express in Administrator mode; we need to do this since our project is actually writing to the registry this time, so it needs administrator permissions. To do that, right-click on Visual Studio and click on Run as administrator.
Go to File | Open Project, browse to the Bestaurants project from the
C:\ArcGISByExample\bestaurants\Code
, and click on Open.Right-click on
frmRestaurantsViewer.vb
and select View Code.In the
cmbCategory_SelectedIndexChanged
method, scroll to the end of the method and add the following code to get the layer and set the definition query of the layer, so that we only display the currently selected category:Private Sub cmbCategory_SelectedIndexChanged...