I'm testing a simple portion of my add in and can't get it to center/pan to a specified point, I've included what is currently in my OnClick() method. No errors appear it just refreshes and nothing happens (10.1 SP1, C#.NET VS 2010).
IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
IActiveView actView = mxdoc.FocusMap as IActiveView;
IPageLayout pLayout = actView as IPageLayout;
ISpatialReferenceFactory srFactory = new SpatialReferenceEnvironmentClass();
int gcsCode = (int)esriSRGeoCSType.esriSRGeoCS_NAD1983;
ISpatialReference spatRef = srFactory.CreateGeographicCoordinateSystem(gcsCode);
try
{
IPoint point = new PointClass();
double xCoord = 33.217918;
double yCoord = -98.158749;
point.PutCoords(xCoord, yCoord);
point.Project(spatRef);
actView.Extent.CenterAt(point);
actView.Refresh();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}