实验五PageLayout属性设置与元素绘制1、新建项目,设置窗体界面如下:2、在主窗体的Load事件中添加如下代码:privatevoidFormMain_Load(objectsender,EventArgse){Microsoft.Win32.RegistryKeypRegKey=Microsoft.Win32.Registry.LocalMachine.OpenSubKey(SOFTWARE\\ESRI\\CoreRuntime,true);axSymbologyControl1.LoadStyleFile(pRegKey.GetValue(InstallDir)+\\Styles\\ESRI.ServerStyle);axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassBackgrounds).Update();axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassBorders).Update();axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassShadows).Update();}3、在“设置边框”按钮的Click事件中添加如下代码:privatevoidButtonBorder_Click(objectsender,EventArgse){axSymbologyControl1.StyleClass=esriSymbologyStyleClass.esriStyleClassBorders;}4、在“设置阴影”按钮的Click事件中添加如下代码:privatevoidButtonShadows_Click(objectsender,EventArgse){axSymbologyControl1.StyleClass=esriSymbologyStyleClass.esriStyleClassShadows;}5、在“设置背景”按钮的Click事件中添加如下代码:privatevoidButtonBackground_Click(objectsender,EventArgse){axSymbologyControl1.StyleClass=esriSymbologyStyleClass.esriStyleClassBackgrounds;}6、在axSymbologyControl1控件的OnItemSelected事件中添加如下代码:privatevoidaxSymbologyControl1_OnItemSelected(objectsender,ISymbologyControlEvents_OnItemSelectedEvente){IStyleGalleryItempStyleGalleryItem=e.styleGalleryItemasIStyleGalleryItem;IFramePropertiespFrameProperties=axPageLayoutControl1.GraphicsContainer.FindFrame(axPageLayoutControl1.ActiveView.FocusMap)asIFrameProperties;if(pStyleGalleryItem.ItemisIBackground){pFrameProperties.Background=pStyleGalleryItem.ItemasIBackground;}elseif(pStyleGalleryItem.ItemisIBorder){pFrameProperties.Border=pStyleGalleryItem.ItemasIBorder;}elseif(pStyleGalleryItem.ItemisIShadow){pFrameProperties.Shadow=pStyleGalleryItem.ItemasIShadow;}axPageLayoutControl1.Refresh(esriViewDrawPhase.esriViewBackground,null,null);}7、在“设置网格”按钮的Click事件中添加如下代码:privatevoidButtonGrid_Click(objectsender,EventArgse){IActiveViewpActiveView=axPageLayoutControl1.PageLayoutasIActiveView;IMappMap=pActiveView.FocusMap;IMeasuredGridpMeasuredGrid=newMeasuredGridClass();IMapGridpMapGrid=pMeasuredGridasIMapGrid;pMeasuredGrid.FixedOrigin=true;pMeasuredGrid.Units=pMap.MapUnits;pMeasuredGrid.XIntervalSize=10;pMeasuredGrid.YIntervalSize=10;pMeasuredGrid.XOrigin=-180;pMeasuredGrid.YOrigin=-90;IProjectedGridpProjectedGrid=pMeasuredGridasIProjectedGrid;pProjectedGrid.SpatialReference=pMap.SpatialReference;pMapGrid.Name=MeasuredGrid;IGraphicsContainerpGraphicsContainer=pActiveViewasIGraphicsContainer;IMapFramepMapFrame=pGraphicsContainer.FindFrame(pMap)asIMapFrame;IMapGridspMapGrids=pMapFrameasIMapGrids;pMapGrids.AddMapGrid(pMapGrid);pActiveView.PartialRefresh(esriViewDrawPhase.esriViewBackground,null,null);}8、程序运行最终界面如下:思考题:1、IStyleGalleryItem接口有哪些属性,各属性有何作用?2、叙述实现“设置网格”功能的编程思路。