private void cmdQuery_Click(object sender, System.EventArgs e)
        {
            //Determine whether permission to search layers
            if (m_queryFeatures == false)
            {
                System.Windows.Forms.MessageBox.Show("You do not have permission to search for features!");
                return;
            }

            //Get IARQueryDef interface
            ArcReaderSearchDefClass searchDef = new ArcReaderSearchDefClass();

            //Set the spatial searching to intersects
            searchDef.SpatialRelationship = esriARSpatialRelationship.esriARSpatialRelationshipIntersects;

            //Get the coordinates of the current extent
            double dXmax = 0; double dXmin = 0; double dYmin = 0; double dYmax = 0;

            axArcReaderControl1.ARPageLayout.FocusARMap.GetExtent(ref dXmin, ref dYmin, ref dXmax, ref dYmax);
            //Set the envelope coordinates as the search shape
            searchDef.SetEnvelopeShape(dXmin, dYmin, dXmax, dYmax, 0);

            //Get IARFeatureSet interface
            m_featureSet = axArcReaderControl1.ARPageLayout.FocusARMap.QueryARFeatures(searchDef);
            //Reset the featureset
            m_featureSet.Reset();
            //Get the IARFeature interface
            m_feature = m_featureSet.Next();
            //Display attribute values
            m_record = 0;
            UpdateValueDisplay();
        }
        private void cmdFeatureSet_Click(object sender, System.EventArgs e)
        {
            Button b = (Button)sender;

            switch (b.Name)
            {
            case "cmdFeatureSet0":
                //Next record
                m_record = m_record + 1;
                break;

            case "cmdFeatureSet1":
                //Previous record
                m_record = m_record - 1;
                break;
            }

            //Get the next/previous feature
            m_feature = m_featureSet.get_ARFeature(m_record);
            //Display attribute values
            UpdateValueDisplay();
        }
		private void cmdQuery_Click(object sender, System.EventArgs e)
		{
			//Determine whether permission to search layers
			if (m_queryFeatures == false)
			{
				System.Windows.Forms.MessageBox.Show("You do not have permission to search for features!");
				return;
			}

			//Get IARQueryDef interface
			ArcReaderSearchDefClass searchDef = new ArcReaderSearchDefClass();
			//Set the spatial searching to intersects
			searchDef.SpatialRelationship = esriARSpatialRelationship.esriARSpatialRelationshipIntersects;

			//Get the coordinates of the current extent
			double dXmax=0; double dXmin=0; double dYmin=0; double dYmax=0;
			axArcReaderControl1.ARPageLayout.FocusARMap.GetExtent(ref dXmin, ref dYmin, ref dXmax, ref dYmax);
			//Set the envelope coordinates as the search shape
			searchDef.SetEnvelopeShape(dXmin, dYmin, dXmax, dYmax,0);

			//Get IARFeatureSet interface
			m_featureSet = axArcReaderControl1.ARPageLayout.FocusARMap.QueryARFeatures(searchDef);
			//Reset the featureset
			m_featureSet.Reset();
			//Get the IARFeature interface
			m_feature = m_featureSet.Next();
			//Display attribute values
			m_record = 0;
			UpdateValueDisplay();
		}
		private void cmdFeatureSet_Click(object sender, System.EventArgs e)
		{
			Button b = (Button) sender;
			switch (b.Name)
			{
				case "cmdFeatureSet0":
					//Next record
					m_record = m_record + 1;
					break;
				case "cmdFeatureSet1":
					//Previous record
					m_record = m_record - 1;
					break;
			}

			//Get the next/previous feature
			m_feature = m_featureSet.get_ARFeature(m_record);
			//Display attribute values
			UpdateValueDisplay();
		}