Select to view content in your preferred language

custom Arcreader and zooming to selected features

2999
0
02-21-2013 06:32 AM
CarlBrydon
Occasional Contributor
Hi Folks,

I am building a custom ArcReader app that has a few buttons in a toolstrip across the top of the axArcReaderControl map
in a Windows form.  One of the buttons is used to launch a second windows form that contains 3 comboboxes; one for
county, one for community, and one for street name.  The 2nd form also has OK and Cancel buttons.
The OK button is supposed to query a layer meeting the criteria in the 3 drop-down boxes and it does correctly return
the correct number of selected features.  However when I try to zoom to or highlight the selected features nothing happens.
Below is the code I have in the click event of the OK button on the 2nd form.  Its as if the 2nd form knows enough about
the first to do the query and get results, but not enough to zoom and highlight.  Any thoughts on how to get zoom and highlight
working from the 2nd form?

Hope someone can help!

Carl


Form1 frmMain = new Form1();
ARFeatureSet pFSelSet;

//Build the ARSearchDef
ArcReaderSearchDef arSearchDef = new ArcReaderSearchDef();

//Build WhereClause that meets search criteria
string sWhereClause;
sWhereClause = "COUNTY = '" + cmbCounty.Text + "' AND COMM_NM = '" + cmbCommunity.Text + "' AND STREET_NM = '" + cmbStreetName.Text + "'";
arSearchDef.WhereClause = sWhereClause;

pFSelSet = frmMain.axArcReaderControl1.ARPageLayout.FocusARMap.get_ARLayer(0).QueryARFeatures(arSearchDef);
//MessageBox.Show(pFSelSet.ARFeatureCount.ToString());

pFSelSet.ZoomTo();
pFSelSet.Highlight(true,3);

//  I've tried this too, but it doesn't work either
//frmMain.axArcReaderControl1.ARPageLayout.FocusARMap.get_ARLayer(0).QueryARFeatures(arSearchDef).ZoomTo();
//frmMain.axArcReaderControl1.ARPageLayout.FocusARMap.get_ARLayer(0).QueryARFeatures(arSearchDef).Highlight(true, 3);
Tags (2)
0 Kudos
0 Replies